From patchwork Wed Oct 26 22:42:43 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: 11448 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519083wru; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46kSO8v7v4Qn0Snpw8RQGKWsUo03xJa4W7Szy8TF5e7tuny7HTdy3KXM1WQTaRMOqM/eMu X-Received: by 2002:a17:907:d22:b0:78e:2788:51ae with SMTP id gn34-20020a1709070d2200b0078e278851aemr38439705ejc.689.1666824279108; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824279; cv=none; d=google.com; s=arc-20160816; b=obfa29RdifA3QbyF5zPasBbkiOB6L9v97iGUGDxPS/285pfIKcRQa2sR4bF88Y3GGV lBQf0S0srTQsFc1n71fvK9BeDYIW0PSSCtdDUdGHIkOcuDh4nG3vmRQx7cxPnCGfOQcO /S+GTLXFNvCdy5+Ksh99KGgwLNal5xadfI395aiQ9hpyzt1zrjcpfJ0pmMO356EMmLyT a7kGOGxsO++zarYObGLmmWPJVJTE8qJYOW4ULz0fNYqHvMcLNLkBfyUwiGelahxOBJtd W98pcMrJmohKNVjHJumDcEgG43VLsGY7xyhKjBaa/zTf0lqedilTC+ypnY190xGXsk+Q JHcg== 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=FySuW4JImM2e8WSAtUL1eyK3K/zsaQUQkfO4wWtJCks=; b=uXE3BdKTu05atPLZ3AyEw3KmiSr3sqthXqILqXFSDsuogmwM+aOirZ6OKzP4pZiAPj MmY2BscbNnGMPSxn7HXykv/O5qENzl489HCrS1+iPkX27ZhISSXdfA3mXsem/eebGvPe J/gTtIT/ZcU++THVk2prmO93bKX3GZmJbNqm6m8B12SLuJTXSCUIpUnQB7VmU3lNzioT 9SqguVIeOiz1yrY1ABV0o/DZHDWMRloq4kQSN3VvG/Oc3bzvc/d6ZoSASUIrukKD1zGp 94tAktHoiZ805t6WmyMz22gprE2OS+lyYjSq8xyfXUZNPyKuUS+D9svgFbuXWu4XUJJY 9vbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Haqz2ZBz; 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 hz2-20020a1709072ce200b007771bc8dbb4si7783981ejc.781.2022.10.26.15.44.14; Wed, 26 Oct 2022 15:44:39 -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=Haqz2ZBz; 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 S233664AbiJZWmx (ORCPT + 99 others); Wed, 26 Oct 2022 18:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiJZWmq (ORCPT ); Wed, 26 Oct 2022 18:42:46 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 584DD15FC9; Wed, 26 Oct 2022 15:42:45 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 8C76C489A; Thu, 27 Oct 2022 00:42:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824164; bh=jNoxRVdm3VuLTQW8ZXbhrbrxzP5u0X1eFmEP42xyPEw=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=Haqz2ZBzsh+Jl1+IFXYjMl5ZH9zqy6r2e9vFJ/0gASL2UmeLSV76EJGhSqdvsZCQC tylCmVInrFF13IwmNkkeQUYX7SunAbTq+mkP5gJiYJd8wUJZkZjwG2NagF80f842TC PhCyizqgHCE4F/i1Sy12+84rETqN7uWVBfKoiEAXGXdBrl4WAyp0nKEAjsno5Osl7f HgfB94NpgOIGSaqFVqDLnCK9v5oKk+ZioSzh40y0mDxmah4ECxUrILygeSvCA3q0HP /uF5hGjOu/a/lSKcSeRMGt3ooCRBdG24vnibiglDFeV4rJUTwnGWEuyu+YPdL9Gn9K bTDkeB+1iWh5XcR2l1Umd2/zi8wSnNrFDtnIDcseWnxaAoAArdj5SVp7aADvFKoRAw bt9704/LqzxScH+b52PUCPzVai1SbeamrfsI0Q8y1ea1eVfBY7l7BRx0DFw5DKpykm 41ZVdmmWpJNC+vfEd0Fifk1554D87zlggjrYSwArkKk9V5pWG+lJtsx+pXfXUPNbdd NfEjiDsHAUfQoPWOQhYt9Nb3FEH+BZjlWQWYRuy9heJ9+IcLfMpYvcrCr0QDf8Ri3e OSglN2vyNpph+KPYVJHMP9NTAtodk9boQ4hCA87krHpqL0sRKWQd6n1sPadXMbiLh2 QWLUCT7y7EYZ0A0MQkmAUsos= Date: Thu, 27 Oct 2022 00:42:43 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jean-Paul Roubelat , "David S. Miller" , Eric Dumazet , Jakub =?utf-8?b?S2ljacWEc2tp?= , 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 02/15] hamradio: yam: remove YAM_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 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,URIBL_BLOCKED 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?1747791935522969814?= X-GMAIL-MSGID: =?utf-8?q?1747791935522969814?= 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 Signed-off-by: Ahelenia ZiemiaƄska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ --- 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;