From patchwork Tue Nov 1 23:05:00 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: 13951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3261501wru; Tue, 1 Nov 2022 16:06:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vJaXLlA/yE/jhB75N+BOJNP4VDqLmZmYgi7UHR033Ni0Zx11FYualLL171rN/5Dc+pWb/ X-Received: by 2002:a63:2061:0:b0:46e:d84b:719f with SMTP id r33-20020a632061000000b0046ed84b719fmr18795253pgm.169.1667343989141; Tue, 01 Nov 2022 16:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667343989; cv=none; d=google.com; s=arc-20160816; b=g/S3tdVLZli95Gq2WhV/mwzBTsGDZUkjsRzsMXjsQ2NQdetURwBMfqfG31ae9UD/ul LNqArCCLCpdLYbICWxJI0nQ3Gx6OzWpf4Pen7DGnIZjkmcB6x2Kf55trYOinqJdJS/hY yyikxu0G04MA3T6K3dKGY0Ne9ukhRkuRNVSFJh3tr9xbtOUhsr4H0pX18HsxRwwMzNSK qe9plCl1JrOVzwLT2AkEYS4vysyUOwJ3kuLxQCO5gmh5wF9VuJyfxeE4jIrO83ClHv/M OyvsL88B3v0ybqUATX//9C7fFSMMAYTkSoL6Ycuy2k9CpUNvEju+KY8RQefgilJTgZyf oLDw== 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=6HjqFzUBjTMeRbXDBLO3/LKIZZCfMDcneS4q9VatxFc=; b=PRuq3mUdstn7eIvFnpzl18s1OV89+hZV2ZoP1bdJNMzFHNsFpq/HcDZVexoTapHDBg 9pKzcvzk6UvRBmfrUiCuV6FgBvyTDylhEqjvl5FaCJTG9yWrb0R01yEzQHh7favJN9ST jfNokQjXT4HYbdILGNaEcp01FekfI+fbKQMOPgRWoYfI46cBHZw0u3ogcrnaS6m44JNp dBNxWpfzcft5P1BfB1alKfiJCMM00fth/Ncw+XTqpo8GEzinCj2f+wa3JWCClUnBkSWF ZXGbAETxGVrq3vm8uplU+mvP9OWL7x3qQaXmrAOm2v1UUnfE5lhrjT0Pqlx69cSm9AdB qldQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=M+LDVQoZ; 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 l15-20020a63ea4f000000b0046f729604fesi4136002pgk.170.2022.11.01.16.06.16; Tue, 01 Nov 2022 16:06:29 -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=M+LDVQoZ; 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 S230499AbiKAXF3 (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:29 -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 S230487AbiKAXFW (ORCPT ); Tue, 1 Nov 2022 19:05:22 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E26DF01A; Tue, 1 Nov 2022 16:05:02 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id C936D4ED6; Wed, 2 Nov 2022 00:05:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343901; bh=sqF6M40mTe+GMCjQFaEsJ1ZjHEHltPKbbHcjSmMmLiQ=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=M+LDVQoZbugRpd3IJ7349nnHdg1XnBeovSVBRsUGuJKds/1CCK56zXFaPbBluGHPc 8OPrWZC0r4y7tkIsZXa7BTGiaGEsLNo1Mn0itPa5PtLPnPn3U6Un/P270AGXwDoHlz MW1ivjN27FAeeM+fUXPwtwkPysSnZVbUnf2AHdoYsp7E6WltF70SxZeGg/ZU8ikiAn BSXDPbRwrWkFDGuYN9Bm0Dy7xZh2T8aOfxqG2244o7O4XgR/pPDkViocfDi3Hm5vvh iHTRjOYqX3MG315jfifJaku+UrJGNChtIRCCy949L+rpVeCX7nY7zic82qbhWAFYYc n8T0yKlhHA/Lf+b9wjPW1sm59p0RElFeLnpPQXDIgN1CCEFEMuU9IdaDRqS0usQ8Ol 00mVM4kJxoD0PorJvEaV61VLW8OjSFPm/dyG5CvB2R3Eq7F/+NK4pPlkrGcazxaIuA WsfRgZgOZKs0oqa5XckglMb3nxUijj2N4SNSJ5Te9u7Hchg5y7XOYz0aufwHIBTg47 0pnVZqIRN+z+gKJ19xJWyv5QbvmjYYYRU600F1t5WnqHB3oLYAYaEdtncQQAc2SHcr ZDP1WW0wRgx4UpjaABuJKXkr9YDenmFdrXd8NzwSi0LsdawXZ8qc6YdSBno7ciGBxK 5LFevY0MwNnnriJBzwg3OTbQ= Date: Wed, 2 Nov 2022 00:05:00 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Thomas Sailer , "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 01/15] hamradio: baycom: remove BAYCOM_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?1748336890490893997?= X-GMAIL-MSGID: =?utf-8?q?1748336890490893997?= Before being defanged in v2.6.12-rc1, the magic was validated on each netdev_priv() invocation; after, it's set exactly once per port on probe and checked exactly once per port on unload: it's useless. Kill it. Notably, magic-number.rst has never had the right value for it with the new-in-Linux-2.1.105 network-based driver, rendering this documentation worse than useless. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia ZiemiaƄska --- Documentation/process/magic-number.rst | 1 - .../translations/it_IT/process/magic-number.rst | 1 - .../translations/zh_CN/process/magic-number.rst | 1 - .../translations/zh_TW/process/magic-number.rst | 1 - drivers/net/hamradio/baycom_epp.c | 15 ++------------- 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 64b5948fc1d4..87353e0207c1 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -73,7 +73,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` 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`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 02eb7eb2448e..a96712bd8a68 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -79,7 +79,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` 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`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 0617ce125e12..44f3a29fce57 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -62,7 +62,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` 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`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index f3f7082e17c6..0fde3183e82a 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -65,7 +65,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` 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`` diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 791b4a53d69f..8f018703e74d 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -45,13 +45,9 @@ /* --------------------------------------------------------------------- */ #define BAYCOM_DEBUG -#define BAYCOM_MAGIC 19730510 /* --------------------------------------------------------------------- */ -static const char paranoia_str[] = KERN_ERR - "baycom_epp: bad magic number for hdlcdrv_state struct in routine %s\n"; - static const char bc_drvname[] = "baycom_epp"; static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" "baycom_epp: version 0.7\n"; @@ -152,8 +148,6 @@ static struct net_device *baycom_device[NR_PORTS]; */ struct baycom_state { - int magic; - struct pardevice *pdev; struct net_device *dev; unsigned int work_running; @@ -1210,7 +1204,6 @@ static void __init baycom_epp_dev_setup(struct net_device *dev) * initialize part of the baycom_state struct */ bc->dev = dev; - bc->magic = BAYCOM_MAGIC; bc->cfg.fclk = 19666600; bc->cfg.bps = 9600; /* @@ -1279,12 +1272,8 @@ static void __exit cleanup_baycomepp(void) struct net_device *dev = baycom_device[i]; if (dev) { - struct baycom_state *bc = netdev_priv(dev); - if (bc->magic == BAYCOM_MAGIC) { - unregister_netdev(dev); - free_netdev(dev); - } else - printk(paranoia_str, "cleanup_module"); + unregister_netdev(dev); + free_netdev(dev); } } parport_unregister_driver(&baycom_epp_par_driver);