From patchwork Tue Nov 1 23:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262418wru; Tue, 1 Nov 2022 16:08:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51q9IwRM4VbaAp6ANb3xzD3IPfADP4DwNfg12nB0ZH53fYuc/E2QE+80aQvg+QpXKGlCJI X-Received: by 2002:a05:6402:2802:b0:43a:9098:55a0 with SMTP id h2-20020a056402280200b0043a909855a0mr21138357ede.179.1667344081889; Tue, 01 Nov 2022 16:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344081; cv=none; d=google.com; s=arc-20160816; b=vIAWvetF3J7C3VrT7WbOEu1hIvYE8i9/p3u0oEA20dw37ET+kVLmRqMD/FNqZHcyM4 86JX//MVUzFyyKAYpEoEleAi7VfV7XRhZ0cwsyjEWjWnqXl5cMroWebF09+xTK1E4Kt0 5dGr2noYQcKmW3F62u4urw2Ut6Bb9JqWMEEIkjzeBUGaHoxIvxsXp4171DgmN0HU/XO7 2xvxgM+UBj2WJR1qLmk3RGN5fpwqZfqzg4b5vRFPNMbfPhQzRPx0297Ah1mDOItyACSJ 07Z65rojbqya0FV+sbq5UlyKi5tJ3AyAJErRmcD267ai31j0OTwsaWQ/BC2Kpbt5qivo oH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=O8SLUSC++D/VFXD+nylZOq9AMKnj7N9xaR3xnStVMtU=; b=ol3PVOXWb6/kbdhCPY2DoOlFycM0ImUHtQIx0nH/K/8U9vkUkqgogaTGW7VSGT+acU r4/P3k3GubRbGbwYRGLEwskgQSBC3r+EV4f7irDJaQnHbu5olFzfUPpxVlotFtgNNNDh 7gggx7t3KOJym13EIA/HUp2JIvMoI89kYz8QNtEyrPbcDgsEQ7JbE/2q2o1bo1wpjqkP HOM0YdzuYhG7hZ5iHqDBiuv+1EbfJ35Rnmd1rV4kueLF3gx9GFYf8bymlemMU6eNza+/ HAZmyeJGkCJ/iOeD1FDKGJJIVLZp57XJIAzvsVE6T5NCIskpt1upXLg1jNlWZz/8hPVR FYVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="ik/mbhUb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh20-20020a1709076e9400b00780e89aecd1si13783454ejc.849.2022.11.01.16.07.37; Tue, 01 Nov 2022 16:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="ik/mbhUb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbiKAXFe (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiKAXFZ (ORCPT ); Tue, 1 Nov 2022 19:05:25 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48C6B2035C; Tue, 1 Nov 2022 16:05:10 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 886E04EDA; Wed, 2 Nov 2022 00:05:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343909; bh=1C2PA3CPeOAdYlYDjeuzEbLN4NuRAcpssYiDt09L1oo=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=ik/mbhUbQpJG7TCVAGlObFN62AVvNN2lkaAWCb2/g7csdiNi85awwxYFqEmw+JME8 11rqLMfv9CiZ8W4xHSqPPaH2KsFpH46nrV9s0lTIXZbJ6Q8eEjfrJVw/jzNBjvMfnx 5xHlEFx/tg6V0haiTl2HiG2gPHbAD2vnFYiyVSpGYzB2iWzAaelhDRACWGNayU1qzq Px9N9SoZKKmgoE0n1I7ySClfoQvxU/K8NbbJCkqIZUhU+ZV+JNWtw5XJ/FppyS68eg e5Otg7sfOw0RVGpVnZ01KAadIW2S/OnBSpO3RvslyzMYe/MQi6mh4obQQxAHcOOzKs Xl9B8B5p+VrYI7JdDZtJPtbgZfgnD7kNjsBWmmwTTeGNmXD166Bhmz92GLeJ3WQvKt UYssTFHFnROrwwqEqGTEQAouTP7TYNjhXHW7wARCd8r18abDA63TeroPY1K4e/JiNO pKDcnJ8A+aDx4YXlRy160HKC8iqOhn8VfXeOvi9yxtYdo2GXcTrh2txrMamMRbEc6b gDSyG/pVO+C0vZnSF25Z1Nq6Es9UTm+WlcCE8/9Jg/WprCmk5DEC+MZQeP29GtMeAP fNUfWOksyCgqU9QGpjuYukr3ZBIB1zdPezdRP0X+8a3UAVo7hJ/LxUKA/6OfkbORko T7I8wKdO5MFx+DV91Qb/uUWo= Date: Wed, 2 Nov 2022 00:05:08 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jean-Paul Roubelat , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-hams@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 02/15] hamradio: yam: remove YAM_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336987620305180?= X-GMAIL-MSGID: =?utf-8?q?1748336987620305180?= This is checked inconsistently, only in contexts following directly from the module init, and returns an error to userspace/ignores the condition entirely, rather than yielding remotely-useful diagnostics. This is cruft, and we have better debugging tooling nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia ZiemiaƄska --- Documentation/process/magic-number.rst | 1 - Documentation/translations/it_IT/process/magic-number.rst | 1 - Documentation/translations/zh_CN/process/magic-number.rst | 1 - Documentation/translations/zh_TW/process/magic-number.rst | 1 - drivers/net/hamradio/yam.c | 8 +------- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 87353e0207c1..a4414b7e15aa 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -76,7 +76,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index a96712bd8a68..f51c5ef9d93f 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -82,7 +82,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 44f3a29fce57..3b53bd67e41b 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -65,7 +65,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 0fde3183e82a..7d176a87ec3c 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -68,7 +68,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 2ed2f836f09a..0f43411a6ca5 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -73,7 +73,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define YAM_1200 2 #define NR_PORTS 4 -#define YAM_MAGIC 0xF10A7654 /* Transmitter states */ @@ -94,7 +93,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define DEFAULT_PERS 64 /* 0->255 */ struct yam_port { - int magic; int bitrate; int baudrate; int iobase; @@ -604,7 +602,7 @@ static void yam_arbitrate(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - if (yp->magic != YAM_MAGIC || yp->tx_state != TX_OFF || + if (yp->tx_state != TX_OFF || skb_queue_empty(&yp->send_queue)) return; /* tx_state is TX_OFF and there is data to send */ @@ -930,9 +928,6 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __ if (copy_from_user(&ioctl_cmd, data, sizeof(int))) return -EFAULT; - if (yp->magic != YAM_MAGIC) - return -EINVAL; - if (!capable(CAP_NET_ADMIN)) return -EPERM; @@ -1079,7 +1074,6 @@ static void yam_setup(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - yp->magic = YAM_MAGIC; yp->bitrate = DEFAULT_BITRATE; yp->baudrate = DEFAULT_BITRATE * 2; yp->iobase = 0;