Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1494097rwb; Thu, 10 Nov 2022 17:32:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf765vGy7FHuweJJENtx1vREnjQFhK/FtdFtCpz2QZYxLbFY99Jb/eK3tKUjftbeDG/7NzPi X-Received: by 2002:a17:906:3e46:b0:78e:1046:c52a with SMTP id t6-20020a1709063e4600b0078e1046c52amr132926eji.713.1668130372572; Thu, 10 Nov 2022 17:32:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668130372; cv=none; d=google.com; s=arc-20160816; b=m0Gtk45K/KemdsAnPF5/CeMD/Qttz1d1sL/KrnILvaTjHp6zvEPkV7ezWCDdaiXm7N K6Gv/mO5ctB3tXd+4WPcK74swCQkc82Kc9QlVSZ37lpIL4A+HX02K7djL2jMfG+BExlX WHATG01IVNt+eYWA5fZ7nT4UoNz/e8YLb5u8T8NkG0dkp/8DEgveHL9VlHiEhV3aV5yi efcNZ87zXME9QAt9yVnKIecox0HdX8ZHae8wm6O7XHe6jsc5U7iYBKQkKuHovpjy1TtM ipqxKIQ52X5BW4tbida7urBxfr/0wPcVbMebMPmZMSYPfoIUw7Jyto8ry5vJjoGBBf+A rXBg== 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=AHgz7mXiWTbv0Xfma/v8PRybGFTnnRkBr8W3gQTx+5M=; b=E5s4Ye5QZkA+Vcfgfk7wLp9S9drokhXDcSYDOA/nidJrHNzKpttzVJm1RO8XFU1Jsc 2/o8wE0znR1pkiJaO4L28ZapwQcLmLqKa85F2wVwiUKGJk25IHx/hym/2USWUAJ97EzW qcY3g/8GNZ/GGmZuvTb8gZxODkWe/YVAvg/qwicEqdAKzOwPKFQIYev4tb+CzqjPkIly KAW8brTfnNo7vYBHUZa05RZ/cvRj9RaFDdeW0W1oFa+NCGPKPngOciftAk40yeRDOCcF 6UPUaDb0cR1fsnTkiNvNuK8cTY3OHKQSFxHGttE59VSkV9FdB1z28/4yoPy1BdsnSMlO 55jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=RX1RxBik; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd5-20020a170907628500b007aea2b23905si827829ejc.812.2022.11.10.17.32.30; Thu, 10 Nov 2022 17:32:52 -0800 (PST) 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=202211 header.b=RX1RxBik; 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 S231995AbiKKBOD (ORCPT + 92 others); Thu, 10 Nov 2022 20:14:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbiKKBNn (ORCPT ); Thu, 10 Nov 2022 20:13:43 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37130A47D; Thu, 10 Nov 2022 17:13:42 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 766A4A18; Fri, 11 Nov 2022 02:13:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129221; bh=CLNSvc89ZjC9lbK/GTozDbmxsjEnpiPpGv/XJ9hwdJQ=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=RX1RxBik8iPH4VuXBVnzZryq49kWAjE15EFD/Cq5OThuHcpOX0A9GGvugUSQPhCEj UlPWpf+eDBfGrdsOjuVr7o20dWdxYxPmDxC3eaqEUhGMYjMs9/kTEbXfjmO3z8CIO3 aSowIpiWZqKHp3HFMdUHcIMy9JWNEIaMBU89bgfQJO9OhErLUg3Wz1Slr59e26CTZh VLLCCnYYxlh8QwWhJS549CVm9b118C7DPhiI6fMd2cmal+pz3T55acxi26nxs/+0MF BhVc7Tkgys+en6Zrlt7hT5zS2UKXEk5wpquOgZEqPDBLu7ZcdS/9gtm+5C2ba+GJqc cvtph5HyEkD4Q== Date: Fri, 11 Nov 2022 02:13:40 +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 v3 01/15] hamradio: baycom: remove BAYCOM_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c64z323at4b56yfc" Content-Disposition: inline In-Reply-To: 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 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 --c64z323at4b56yfc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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/ Acked-by: Jakub Kicinski Signed-off-by: Ahelenia Ziemia=C5=84ska --- 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/mip= s/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/Do= cumentation/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/mip= s/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/Do= cumentation/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/mip= s/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/Do= cumentation/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/mip= s/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/bayco= m_epp.c index 791b4a53d69f..8f018703e74d 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -45,13 +45,9 @@ /* --------------------------------------------------------------------- */ =20 #define BAYCOM_DEBUG -#define BAYCOM_MAGIC 19730510 =20 /* --------------------------------------------------------------------- */ =20 -static const char paranoia_str[] =3D KERN_ERR=20 - "baycom_epp: bad magic number for hdlcdrv_state struct in routine %s\n"; - static const char bc_drvname[] =3D "baycom_epp"; static const char bc_drvinfo[] =3D KERN_INFO "baycom_epp: (C) 1998-2000 Th= omas Sailer, HB9JNX/AE4WA\n" "baycom_epp: version 0.7\n"; @@ -152,8 +148,6 @@ static struct net_device *baycom_device[NR_PORTS]; */ =20 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_de= vice *dev) * initialize part of the baycom_state struct */ bc->dev =3D dev; - bc->magic =3D BAYCOM_MAGIC; bc->cfg.fclk =3D 19666600; bc->cfg.bps =3D 9600; /* @@ -1279,12 +1272,8 @@ static void __exit cleanup_baycomepp(void) struct net_device *dev =3D baycom_device[i]; =20 if (dev) { - struct baycom_state *bc =3D netdev_priv(dev); - if (bc->magic =3D=3D 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); --=20 2.30.2 --c64z323at4b56yfc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmNtocQACgkQvP0LAY0m WPHDVhAAstg9jWXp75Un6VrU+otwggCOvW+M2Y0a4dgC/YNA7mLtd54EZGqHYHH+ AzS0CeTCFzX3gbBEuvo11aaHYYzG8ooUXPKwjfSkUkuV1RFkuyuY0BzoLArZwWXT /TLR7cC9YEXy8y8j48LNgf7YEq1/XY5NJObdtvRXcGE4aNGXX5K9RL9UCpZwRfw/ N8yDZCAYFi70QplXy3HZbYy6DUK+BquvaGzh7gBhNMzTxmtnr9RtSBlFfdLx/0mU zfSwDzzc425QJLJDYWpr+CZ/8UARKC/j7SMtWjbczXwYd1w8wgYJehpbirsJ/b58 SARsa4ZQHLWuuKmHzBVNjMuz+R1biGqSD/gFvq7xkFx+YEPhKOX3uL3wnPWaPSDq WCUqTCuCMZIl3KI2K+Y1RLxdI7kpCNROqnjkBncmaMmW2rUjB7F48SRQ8OLm39G6 xbFbcbMaczIk5rzYPWQQ2mrUHu5eKZDvWNsbwWMbMI/vZ9Vm8v45gNCFVJ4T3ctA cfwqS7GxPLppnQ3hg+bCKVMTEn12RqjGoMbm5JNRoYLUwtUHdL/dqR3KR5A1AFWx qvRMiJO+qasM4newd6odxgV+uNB51pWZkdzxk3utZEsWdLatCbrP6hZo+/ufSvyk wnI9am21xxUzfd41vaJn2v5cMT7Jm64/jKhvV+HcXBmuzqGqlmQ= =50/v -----END PGP SIGNATURE----- --c64z323at4b56yfc--