From patchwork Fri Nov 11 01:13:40 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: 18354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp470625wru; Thu, 10 Nov 2022 17:15:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4n/sppa/Sx2O/iaQbfPK5994RZvz2CNSDyP4UyuUo1ZRf6h7yoY4FiLfuh+bFMEFGTlI4W X-Received: by 2002:a05:6402:2419:b0:466:1bfa:c39e with SMTP id t25-20020a056402241900b004661bfac39emr3673245eda.240.1668129309589; Thu, 10 Nov 2022 17:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129309; cv=none; d=google.com; s=arc-20160816; b=dWy2QsHD+nf39RWyc3HnRXTBAznREEr1pXi3XUv+wO0+bhp4/yegndvdQjpHiUVtfL vPgLovB50oB/ibClyh4dl9UfDtiJIVhfHrI2lfjxuS5UPUJNSftYPUtDZQyfgnQ3VZWP 1MW7KcqccWuvt5zXTqLW1Mg+L23on05JBnwyzk141SAs6Scsm6OQ/XyWrZ4SG0YRYt7A b1V9lCV8lHpahH1a7Ppvy9W2218Tw3R2Cxfb74MyuBHz22lIQqhOCbeXkyF0tM7PQfIH tm30zSodG8L4Et/sog4hI9qnhuVjnP3Jka5oSdqB32giVG3tYanIvfC0sqspeKgsUdbU oCDQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020aa7c584000000b0045bd677b3d5si858753edq.342.2022.11.10.17.14.43; Thu, 10 Nov 2022 17:15:09 -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 + 99 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-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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160358991423698?= X-GMAIL-MSGID: =?utf-8?q?1749160358991423698?= 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ń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); From patchwork Fri Nov 11 01:13:45 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: 18363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471248wru; Thu, 10 Nov 2022 17:16:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4q9UtJ1OpHEgdtQC8311EEBQcR3vHjHj+0x4xHhxt3/Nwj7XtGeZORdSjUwCvy8o5P5fe0 X-Received: by 2002:a17:907:961d:b0:78d:9582:dfbb with SMTP id gb29-20020a170907961d00b0078d9582dfbbmr113772ejc.612.1668129410724; Thu, 10 Nov 2022 17:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129410; cv=none; d=google.com; s=arc-20160816; b=o0WLYZr7FMrNGJkwWUAPHgGb1ct0YQmKaFICYacOf/Uo38VuPztjbP0CCpkwu6BBoX yXE7Z3LJVPLJe0ztU0Iz+YPk42QlSV5OwDhMUynhkpq4XoM7Yzr8AIS9hnEaEhyPvLP1 FkXYKvr/dmUj4JipuoGji8+64HKlvWx453V1/MiOYBxKABD7Ivd9shQLK06U3Xk+l69V gb4MBU7ezLYffrqKptIaR+2Q+H/yYXvcG4fRQDdLJlMSL+R+yMw/pYH3qep5Kx24y3pQ YFpiApd/LB/L/G5PWvJbRoFBX6JzZsU3eMbENnduRdxYTfEtyIWvYrpjMsypXlVFC4GS ERig== 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=Je8dqgZxphV2fRNPL7Gm+rLaJpm6EhZHJ2LYWBvcggQ=; b=CMyCk4rozIC40mP4zJUHFSe7ZkxrcKOD4Ut0Y0LsGJSk/ip6iR+TCG9Nggf32kB34T KfFvXN8fWYDpeNo+OW5HFUlvZcXcEIDvZlE5KLpKuqeES5fQvjfWdTJAhw+8P+F7WoPy ZoSotRkA9zjPcbqbv93j1zOyhECXwebdGcxFr7aC5Fhz+yeJAZtbmUeWKn5b7gSbvBj4 LzhiS8bamuLIX25Brr7FsAQwlbgqIn3uKw8lu153PFhX/tRra/R3TDXRxJWHNl1Ve+TP BCymuir+e3kpBFE9yt+kPFyWiO4sHQn7S2WdkVREglfPny/xipToVCLZNce6yWjb65q4 Hn9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=QQDqgPnP; 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 qf29-20020a1709077f1d00b0078e27ef9501si832005ejc.750.2022.11.10.17.16.26; Thu, 10 Nov 2022 17:16:50 -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=QQDqgPnP; 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 S232035AbiKKBOG (ORCPT + 99 others); Thu, 10 Nov 2022 20:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231866AbiKKBOA (ORCPT ); Thu, 10 Nov 2022 20:14:00 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D38C12AC7; Thu, 10 Nov 2022 17:13:47 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 88FCBA1A; Fri, 11 Nov 2022 02:13:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129226; bh=ixdDLzJmpTxWbfhVg6Gc6gD5JwL8vejNHMAi6eeYrns=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=QQDqgPnPrgCKsWAjM5mqrzHpqDM7wJoH2yW8jeEJeDs7ac8hciVMV8iZll9/4CIAw XDeBUTZbBtAvZloNuQ/1CVWOtkEFYZlNz1S7sAkv7HRff20UDw4vsMgXoykCOmV/fJ u8BWwNOAmjT7Arhtw8tCUKlWlhDpHcVtGWcMmEVLonD+6JtmBRUdxa58Mz+fNX+GJz khDDynlWI0DJznfY0KGL7n8dNRJ5yrVvL9w2VeOSeDUYs3hTlO4cKEpTDVPSDoempU Jf2i8MYx4jKHQvNpvohV00Nf/CpbKrVGZ0Pc6Z8WBvbvcnNWb7pSdYUNt64KHwZUmM ArdBDuE6nxmwA== Date: Fri, 11 Nov 2022 02:13:45 +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 v3 02/15] hamradio: yam: remove YAM_MAGIC Message-ID: <25af8e199860c8f3a33ea32abb77fbf54a6cfe64.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160464888890565?= X-GMAIL-MSGID: =?utf-8?q?1749160464888890565?= 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/ Acked-by: Jakub Kicinski 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; From patchwork Fri Nov 11 01:13:49 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: 18357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp470990wru; Thu, 10 Nov 2022 17:16:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf70V4462beloA9iJM+dbzeX6S1lNgkv1uYcN1eOsulGdAlvTX1UKumfevbrP8XJmLdkC6Ht X-Received: by 2002:a17:906:e0c2:b0:7ae:6ffe:a118 with SMTP id gl2-20020a170906e0c200b007ae6ffea118mr172381ejb.250.1668129368681; Thu, 10 Nov 2022 17:16:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129368; cv=none; d=google.com; s=arc-20160816; b=pOdq9QSHLrLWI4dAMFQW3Ez15jAYIgHuqnpzpfJ108RSjDef88/hhanmNONTWQjCs8 lDVdioVhFK8u/Nu8m4YaWRT1UULjKWxavS6hBDdKZUJvRvElsv2eiMDVlrCk+k4wHlnd OC6ilYfmLBwz01ieaQLrSEWVjx2b6jLf1uckMO83KTXQQT+LMJI3Ag24TkiophpLKboe ZMailE7NJeWdhODiLhf8nnXJIjicIDpcoycq3sN4JobN1Ez+oI7UCv6q6F+tr+0S9QJN mXKN8fw+gOSQXLf79nmZ50rM6Vss2IxeirpCeLNLKIXFUJAqqys0Ug0UT2KkS9GmZy0w 2RiQ== 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=tgLmRPRLEC0L5YS0Aqpgl2cILF1wmMFEZRlG5N30B7k=; b=Bljcj1q1RUphmqeQIyMstWujQD2tLoruS6C0XJdTBhm5l4jnqKBQAvDoMce1ZYCcRg e36z198Bo7nn7Tmd2SsCVydh3Ac8Syexb/pduS/mjOKl7smvUMaHuWVW6kVx5uBYfpQz OTVOdSZa2OJJ23jOHNnvUkNLjfa4ZQubUEBZWrpOQPzlWqFc/YMcf0AZnTjPtWIiajh/ sLHOk1WnMIbTbwOxgGz0zMERb5hwP15eMBHDvk8rLbDRksMDa7MYE1ZJyPZWGxexDvWD tRB6aYKgw5iBJKWrRzyuBXo1xhsEWk81FLVsoJBe2ofts0WMKASntD1tcT4mzUyKqN1u zbLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=KUADlVZ0; 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 kx15-20020a170907774f00b007a5cdd9550esi643719ejc.201.2022.11.10.17.15.32; Thu, 10 Nov 2022 17:16:08 -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=KUADlVZ0; 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 S232097AbiKKBOQ (ORCPT + 99 others); Thu, 10 Nov 2022 20:14:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231979AbiKKBOD (ORCPT ); Thu, 10 Nov 2022 20:14:03 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8F3DC19025; Thu, 10 Nov 2022 17:13:51 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id E1BE8830; Fri, 11 Nov 2022 02:13:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129230; bh=2qw6TvHBv7fuk35THthOMAX/8jL0jt7zA08jqmpyNqA=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=KUADlVZ00qHvy8pFOiMs8eB0n6a0OfHjICx8XT1wT+TcjVOmYhPX8yH8AVbZGH6ot SxUnGNUhN2L+n/PTFQ2L9R8OnZofF6d0bg7u1Co/VEPDxqokeFggFdFouBvHcZq7sp OgSDq2aYxQpfbeFdoo1kbxYozVYVU8Mne3+Ri6f4r4YG7cqsR+3KRl1RnMCpAlxPao mNkmqvoqcrgEVTG/7l6+HNaZQov651BUMmiVE0S3psyIknmENaR3Ebf5qDJ21tzTO9 xcm7lf0uf70xQQ2HTwozxE8MGNY9C/LCqhr2iafUnbIWQFn+UGWJiQn5Xnq38zSocG p6oAirCizknSA== Date: Fri, 11 Nov 2022 02:13:49 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Arnd Bergmann , Greg Kroah-Hartman , Jakub Kicinski , Jiri Slaby , Ilpo =?utf-8?b?SsOkcnZpbmVu?= , Haowen Bai , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v3 03/15] pcmcia: synclink_cs: remove MGSLPC_MAGIC Message-ID: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160420845004624?= X-GMAIL-MSGID: =?utf-8?q?1749160420845004624?= MGSLPC_PARANOIA_CHECK has never been defined automatically, and in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this". This is 100% dead 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 - .../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/char/pcmcia/synclink_cs.c | 10 ---------- 5 files changed, 14 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index a4414b7e15aa..18f8b1e3a993 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -72,7 +72,6 @@ PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` 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`` 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 f51c5ef9d93f..827167b18f15 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -78,7 +78,6 @@ PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` 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`` 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 3b53bd67e41b..9553475e9867 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -61,7 +61,6 @@ PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` 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`` 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 7d176a87ec3c..8a64f56ae267 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -64,7 +64,6 @@ PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` 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`` 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/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index b2735be81ab2..262f087bfc01 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -137,7 +137,6 @@ struct _input_signal_events { typedef struct _mgslpc_info { struct tty_port port; void *if_ptr; /* General purpose pointer (used by SPPP) */ - int magic; int line; struct mgsl_icount icount; @@ -228,8 +227,6 @@ typedef struct _mgslpc_info { } MGSLPC_INFO; -#define MGSLPC_MAGIC 0x5402 - /* * The size of the serial xmit buffer is 1 page, or 4096 bytes */ @@ -525,7 +522,6 @@ static int mgslpc_probe(struct pcmcia_device *link) return -ENOMEM; } - info->magic = MGSLPC_MAGIC; tty_port_init(&info->port); info->port.ops = &mgslpc_port_ops; INIT_WORK(&info->task, bh_handler); @@ -652,8 +648,6 @@ static inline bool mgslpc_paranoia_check(MGSLPC_INFO *info, char *name, const char *routine) { #ifdef MGSLPC_PARANOIA_CHECK - static const char *badmagic = - "Warning: bad magic number for mgsl struct (%s) in %s\n"; static const char *badinfo = "Warning: null mgslpc_info for (%s) in %s\n"; @@ -661,10 +655,6 @@ static inline bool mgslpc_paranoia_check(MGSLPC_INFO *info, printk(badinfo, name, routine); return true; } - if (info->magic != MGSLPC_MAGIC) { - printk(badmagic, name, routine); - return true; - } #else if (!info) return true; From patchwork Fri Nov 11 01:13:54 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: 18355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp470798wru; Thu, 10 Nov 2022 17:15:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM4v1AwGY4rgBE9Iv5kibTg695jYIBUX4K0RRNNcCc3B41NFce3cD1v4/CSk2DWhIY4ghCqZ X-Received: by 2002:a05:6402:c13:b0:462:2e27:3bf2 with SMTP id co19-20020a0564020c1300b004622e273bf2mr4096916edb.13.1668129335642; Thu, 10 Nov 2022 17:15:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129335; cv=none; d=google.com; s=arc-20160816; b=lr7Yk1e5ewNN4LZ8HcbAwh9/O2YB/lHxIQEGEyKkn2x8s74SKuROUEW7G3Bf9BtV+x D7ph0VySsdfPpI6b3GwnKuKkYlwFnPm4Y4ohJtkPkkMVJMHhiV29z54ra3I+tWS2UyAw yxkcx9Td1mJTTqrEfCCOiaEAWcOb93FrYgXd8+fVVQppscwk+sGznIFLUA1BdU83NA/o VZkc02vPIjBpBkoL2274uV8zul0cEPmOCOZAx5+qTvfC8YAsG/+jNo6dUfZc8nW54T+e qlpvFi5qcabtsodQXRbC1TEdTsBvLW50aHPLsvIpMevZozx5U4QptZ726X1AaOSDZYUl azoA== 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=lTZfE+g83sOEjvF5QvAed7W9T6e0IEQB94bjQRMl5NA=; b=cAiQGrjmHxRsJNEfTeTFowZ4BuBoQT+yy7YOAMmruwyW7fAx8UGt2QUskyKvqcYCaV GEnjvs6+WIoOyYeI3Fw+aTATYg3ygEb0RU3RWHGSnppdyzHK9qoR10EI3cqETYKzE1s1 ZUl47NG4X+nuQbeXYD2K29VxeS5+73Owvi61ARtpXA+RmFuNN8mk+Zky8ggsJbxPRYql YcgWfs+yn4P3WG0ogsIAZuxBkIfyEReNz+Fla4WqBSB0DE3TlFjasJEpcDclMjWTST8M h5nEHyuPyeP54leVFcu59otokbso96sdyyeEorohkwv+jWgQIpL9B+Yv3C570Laxoipl WOSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=KvOYeYyf; 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 e19-20020a056402191300b004571c47b13csi1159778edz.418.2022.11.10.17.15.10; Thu, 10 Nov 2022 17:15:35 -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=KvOYeYyf; 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 S232177AbiKKBOl (ORCPT + 99 others); Thu, 10 Nov 2022 20:14:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbiKKBOE (ORCPT ); Thu, 10 Nov 2022 20:14:04 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 21FAE4D5FB for ; Thu, 10 Nov 2022 17:13:56 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 707E83E; Fri, 11 Nov 2022 02:13:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129235; bh=0kckHfo17/7CxxS3uU74bmVO2tWtQZd8qM2WTPZDjoc=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=KvOYeYyf4R08Vzi6NMJT5zJQ0D3fVkYp8mStu1m+acRHG2dA2VPtn13CE9PV8OTld d/WKEmGkD7wrMCwb2HyhNRevVbKW5Fl7dkR3Mb3glaIsAWj8IXU2PHhClE2dgHO7GK BOMvt6fnHAhrmmgygJWcLa4NEpdW19AOW8/Njn5NuPNGIylAzcvUqoMjutk9O/Rfv1 /jN+khTui7ZzAs1Cefzk49MlPGA9qyk4U3X7lqkHgQCtPu4LiedNOn9zKfFuaiFv0x opQ5VptNI5sgCBAKqIYCvLx3OqSjQVC9ZvNuoQf3mTXms8RgVhINr3Mp7C/+2GAJ3e lQX049droUA4Q== Date: Fri, 11 Nov 2022 02:13:54 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Arnd Bergmann , Greg Kroah-Hartman , Ilpo =?utf-8?b?SsOkcnZp?= =?utf-8?b?bmVu?= , Johan Hovold , Jiri Slaby , Haowen Bai , linux-kernel@vger.kernel.org Subject: [PATCH v3 04/15] pcmcia: synclink_cs: remove dead paranoia_check, warn for missing line Message-ID: <6632531db322b3b2ca8088088ad6c685cf0f8983.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160386374851431?= X-GMAIL-MSGID: =?utf-8?q?1749160386374851431?= MGSLPC_PARANOIA_CHECK has never been defined automatically, and devices with null driver_info can't happen, since we reject the open in that case. Move the log statement from dead code to the check, and log the state inconsistency like we do above for the line count ("invalid line #%d."). Signed-off-by: Ahelenia Ziemiańska --- drivers/char/pcmcia/synclink_cs.c | 69 ++----------------------------- 1 file changed, 4 insertions(+), 65 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 262f087bfc01..5aecb5e5cf18 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -644,25 +644,6 @@ static int mgslpc_resume(struct pcmcia_device *link) } -static inline bool mgslpc_paranoia_check(MGSLPC_INFO *info, - char *name, const char *routine) -{ -#ifdef MGSLPC_PARANOIA_CHECK - static const char *badinfo = - "Warning: null mgslpc_info for (%s) in %s\n"; - - if (!info) { - printk(badinfo, name, routine); - return true; - } -#else - if (!info) - return true; -#endif - return false; -} - - #define CMD_RXFIFO BIT7 // release current rx FIFO #define CMD_RXRESET BIT6 // receiver reset #define CMD_RXFIFO_READ BIT5 @@ -694,8 +675,6 @@ static void tx_pause(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; - if (mgslpc_paranoia_check(info, tty->name, "tx_pause")) - return; if (debug_level >= DEBUG_LEVEL_INFO) printk("tx_pause(%s)\n", info->device_name); @@ -710,8 +689,6 @@ static void tx_release(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; - if (mgslpc_paranoia_check(info, tty->name, "tx_release")) - return; if (debug_level >= DEBUG_LEVEL_INFO) printk("tx_release(%s)\n", info->device_name); @@ -1476,9 +1453,6 @@ static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch) __FILE__, __LINE__, ch, info->device_name); } - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char")) - return 0; - if (!info->tx_buf) return 0; @@ -1508,9 +1482,6 @@ static void mgslpc_flush_chars(struct tty_struct *tty) printk("%s(%d):mgslpc_flush_chars() entry on %s tx_count=%d\n", __FILE__, __LINE__, info->device_name, info->tx_count); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_chars")) - return; - if (info->tx_count <= 0 || tty->flow.stopped || tty->hw_stopped || !info->tx_buf) return; @@ -1546,8 +1517,7 @@ static int mgslpc_write(struct tty_struct * tty, printk("%s(%d):mgslpc_write(%s) count=%d\n", __FILE__, __LINE__, info->device_name, count); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") || - !info->tx_buf) + if (!info->tx_buf) goto cleanup; if (info->params.mode == MGSL_MODE_HDLC) { @@ -1600,9 +1570,6 @@ static unsigned int mgslpc_write_room(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; int ret; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write_room")) - return 0; - if (info->params.mode == MGSL_MODE_HDLC) { /* HDLC (frame oriented) mode */ if (info->tx_active) @@ -1632,9 +1599,6 @@ static unsigned int mgslpc_chars_in_buffer(struct tty_struct *tty) printk("%s(%d):mgslpc_chars_in_buffer(%s)\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_chars_in_buffer")) - return 0; - if (info->params.mode == MGSL_MODE_HDLC) rc = info->tx_active ? info->max_frame_size : 0; else @@ -1658,9 +1622,6 @@ static void mgslpc_flush_buffer(struct tty_struct *tty) printk("%s(%d):mgslpc_flush_buffer(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_buffer")) - return; - spin_lock_irqsave(&info->lock, flags); info->tx_count = info->tx_put = info->tx_get = 0; del_timer(&info->tx_timer); @@ -1681,9 +1642,6 @@ static void mgslpc_send_xchar(struct tty_struct *tty, char ch) printk("%s(%d):mgslpc_send_xchar(%s,%d)\n", __FILE__, __LINE__, info->device_name, ch); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_send_xchar")) - return; - info->x_char = ch; if (ch) { spin_lock_irqsave(&info->lock, flags); @@ -1704,9 +1662,6 @@ static void mgslpc_throttle(struct tty_struct * tty) printk("%s(%d):mgslpc_throttle(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_throttle")) - return; - if (I_IXOFF(tty)) mgslpc_send_xchar(tty, STOP_CHAR(tty)); @@ -1729,9 +1684,6 @@ static void mgslpc_unthrottle(struct tty_struct * tty) printk("%s(%d):mgslpc_unthrottle(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_unthrottle")) - return; - if (I_IXOFF(tty)) { if (info->x_char) info->x_char = 0; @@ -2160,9 +2112,6 @@ static int mgslpc_break(struct tty_struct *tty, int break_state) printk("%s(%d):mgslpc_break(%s,%d)\n", __FILE__, __LINE__, info->device_name, break_state); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_break")) - return -EINVAL; - spin_lock_irqsave(&info->lock, flags); if (break_state == -1) set_reg_bits(info, CHA+DAFO, BIT6); @@ -2218,9 +2167,6 @@ static int mgslpc_ioctl(struct tty_struct *tty, printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__, __LINE__, info->device_name, cmd); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_ioctl")) - return -ENODEV; - if (cmd != TIOCMIWAIT) { if (tty_io_error(tty)) return -EIO; @@ -2312,9 +2258,6 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data; struct tty_port *port = &info->port; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_close")) - return; - if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_close(%s) entry, count=%d\n", __FILE__, __LINE__, info->device_name, port->count); @@ -2352,9 +2295,6 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout) printk("%s(%d):mgslpc_wait_until_sent(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_wait_until_sent")) - return; - if (!tty_port_initialized(&info->port)) goto exit; @@ -2412,9 +2352,6 @@ static void mgslpc_hangup(struct tty_struct *tty) printk("%s(%d):mgslpc_hangup(%s)\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_hangup")) - return; - mgslpc_flush_buffer(tty); shutdown(info, tty); tty_port_hangup(&info->port); @@ -2468,8 +2405,10 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) info = mgslpc_device_list; while(info && info->line != line) info = info->next_device; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_open")) + if (!info) { + pr_warn("%s: no device for line #%d.\n", __func__, line); return -ENODEV; + } port = &info->port; tty->driver_data = info; From patchwork Fri Nov 11 01:13:58 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: 18356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp470906wru; Thu, 10 Nov 2022 17:15:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf55yEOotF1SzWPx9s/6u/MSKiDsJZsznVDE0hgusCvf9EJyvRiwCmMP3ROA6m4HAp3cSmwH X-Received: by 2002:a17:906:e29a:b0:78d:d2e5:7a11 with SMTP id gg26-20020a170906e29a00b0078dd2e57a11mr200526ejb.144.1668129358081; Thu, 10 Nov 2022 17:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129358; cv=none; d=google.com; s=arc-20160816; b=nUWcW2VYxhxBLH12SWZhCdkree/7VKTfROnQsQF0x/23D6MhYqkWYs4+3lXK61X9+9 kx7KZTNhnJ+HnZsq1+Gv4FWLXsZSUWXVj32cwCBMJbv9uEER2lxOpH83lBUZpGyfdw+5 zzP/WS5dTXbVnORHkvA9nz1lTYwkdxziQKu2QA+9WjOeIoUo7xyDbjqG1S49ozDgZkqV VdGePHXKdWvFsqj5cVPrKt7RX/Zz5TQOl2Zfelt6s2xQjWoScVRmFVrF2+PQ/UaSd6tY AEiaML/doQ1NvedlSrpz0AbdG7m2Rv8RwE2ae3hYPz1wHzll8uLroSR2M/pY8HgsDpNp tFfA== 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=KE8QM1xuPxpgi+WnUgcAUa3Uy1HM6sgMxDiUInA0eFg=; b=DxEe3WyIycJNdN4mY9o8S4Qyq14gFF9dHNd2b9eimoHxVXZbhDwPaiKJY7QwEmpkac AoUchIMJqaiHo33t9tKxuNvhQG6XhfAQpAmvA3+Znj7vcIiDjZJItBT4tcB8I16ea/Rv NuLAnuSoEDET/4Hb1lOPN59XmR+Ix5U2CpQ/8w5OTB42lTBB2aFhQytLgXTRLkLcUzyl rGzpqzbyjYu04di8+vdHBAm4Nbz/Dls4RMfWOrmgTuKKxMGLlQx9PvhKZRxi1fhacun2 JoWcOnKmFY7Lf6yqnM5ZfiYyUHGpPokqGA18kL6gsMTGCo1jeCuZfmVltbKGICvWExIf n5Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=osTVRJ7T; 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 dr8-20020a170907720800b007ae9bc0b98asi754299ejc.484.2022.11.10.17.15.31; Thu, 10 Nov 2022 17:15:58 -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=osTVRJ7T; 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 S231977AbiKKBOo (ORCPT + 99 others); Thu, 10 Nov 2022 20:14:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232048AbiKKBOH (ORCPT ); Thu, 10 Nov 2022 20:14:07 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B7A0BE20; Thu, 10 Nov 2022 17:14:00 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id DD121A20; Fri, 11 Nov 2022 02:13:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129239; bh=EmS73flWSI5awH2OX02dV/dWRq9xdQACUG/VomspvD8=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=osTVRJ7T0aZNSh32hMSp9Fu3rZjCBSq6Whj6NpFfXpgzsOE4C8bHvuVgqlKavX7rf ZVJf2CT1iikTPNJ+3xiZov8Dop77RyGyk6TOK5yA/S99cTIbswDQxh5cMtZ15F5KtW 9I7BeBMV+vdJP0ia13P9W09g02wXeG94kRYv09dAFSbrka+meHGSZ7ncZfWhuVrTha fNwarmvdmpN+j516npYjEtEkNichcf69AWKiKLzFErXxt9N5whiw+p9QDjd2lHcfla vTKF4qOBKcI2Gwk08xh3XzWGacxqjxdtIRkYsygu+1M86md7pd4W1sMbe49meyF+xL SOlw69S9C01iA== Date: Fri, 11 Nov 2022 02:13:58 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jan Harkes , coda@cs.cmu.edu, Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, codalist@coda.cs.cmu.edu Subject: [PATCH v3 05/15] coda: remove CODA_MAGIC Message-ID: <91a186d5a3ebebb10ca5f9dd460448ff42c5229d.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160409532114304?= X-GMAIL-MSGID: =?utf-8?q?1749160409532114304?= We have largely moved away from this approach, 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 - fs/coda/cnode.c | 2 +- fs/coda/coda_fs_i.h | 2 -- fs/coda/file.c | 1 - 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 18f8b1e3a993..335169e43be1 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -74,7 +74,6 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 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`` 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 827167b18f15..699b681088ac 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -80,7 +80,6 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 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`` 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 9553475e9867..d1ede86944f1 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -63,7 +63,6 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 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`` 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 8a64f56ae267..1dd01f1e1c17 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -66,7 +66,6 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 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`` 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/fs/coda/cnode.c b/fs/coda/cnode.c index 62a3d2565c26..e217cca338bd 100644 --- a/fs/coda/cnode.c +++ b/fs/coda/cnode.c @@ -157,7 +157,7 @@ struct coda_file_info *coda_ftoc(struct file *file) { struct coda_file_info *cfi = file->private_data; - BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); + BUG_ON(!cfi); return cfi; diff --git a/fs/coda/coda_fs_i.h b/fs/coda/coda_fs_i.h index 1763ff95d865..9e4b54dbe7d7 100644 --- a/fs/coda/coda_fs_i.h +++ b/fs/coda/coda_fs_i.h @@ -35,9 +35,7 @@ struct coda_inode_info { /* * coda fs file private data */ -#define CODA_MAGIC 0xC0DAC0DA struct coda_file_info { - int cfi_magic; /* magic number */ struct file *cfi_container; /* container file for this cnode */ unsigned int cfi_mapcount; /* nr of times this file is mapped */ bool cfi_access_intent; /* is access intent supported */ diff --git a/fs/coda/file.c b/fs/coda/file.c index 3f3c81e6b1ab..c23f846bf206 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -222,7 +222,6 @@ int coda_open(struct inode *coda_inode, struct file *coda_file) host_file->f_flags |= coda_file->f_flags & (O_APPEND | O_SYNC); - cfi->cfi_magic = CODA_MAGIC; cfi->cfi_mapcount = 0; cfi->cfi_container = host_file; /* assume access intents are supported unless we hear otherwise */ From patchwork Fri Nov 11 01:14:03 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: 18364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471272wru; Thu, 10 Nov 2022 17:16:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7EoJ/DAM4dqQxwtYPffIaVJ/3zUKqFGZSEROK3DUK+csgJRsvqOGrf3J1/CHmpCGPmlSV3 X-Received: by 2002:a17:907:7659:b0:7a0:3125:f1e5 with SMTP id kj25-20020a170907765900b007a03125f1e5mr161766ejc.314.1668129412885; Thu, 10 Nov 2022 17:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129412; cv=none; d=google.com; s=arc-20160816; b=JZMvLDl//AHFYzT+67qVV2xdupDswiiXQXWpIgmbVGOw9qT9NvWw9V/4AblzU1ox9F CmUpxkGL1xIweU+5vZ7ROVcgwRNXpkJ/DfF9W1WWAXLcP363zXMDSmmao5rDmX1W8ESM yEaLGFa0Mka6X2gHygqFElbcey2Jr80XfiLu4ID8d9LAG7+HL2EHdlrOsFcFLVsj6gxw P/CfbgqM4v7IhPgOToODCaUefRv3lL6+FPmHcHejW6TfkR37cGP45P4HbUjBL/0CTna2 CSJ0s5eBCF3Vrg0tzDdkf0DUv25rLkBY/wdvLVdT6oz/KZQ51ngDHlMtCApaIeIheod0 jYCQ== 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=LYqyYzV/V+z+Ryqzfk0rG5NRfkLy5YHXD1TtVq5sxxs=; b=zgC2zRCKR3RHHgQoK2RHr2rOO2LlKsqzdBdBSCFz8WMAsokUTjEFGQNfD+UdLO7lIB cSSeA/zNRi1PQJJLHQrn/ObDzmNKTRGNluHF0dVYa1roHXK0aOuuUxQWycTqCnPA68O2 dOE9wkrkKhs1NdXEBdz7sYdS9iKrKHpvqpazTrVQr8UEqZVE7fvMQOhiaPZIx/e6Ay+m A3a3QR7VbhTTpKX3yto9WusWLQ+dLWhYrLnInYrKCrTGtpz2k89Ubv5Hf+0d/9SYP9Qr h/4Qdym2F9e0Z/3vF85LTQrujCJRPpHAqhs/MMyRE914DnmlJNOF7jmoawEnOt7rilQu 13QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=eFymu142; 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 js15-20020a17090797cf00b007ae6869f9d9si896020ejc.419.2022.11.10.17.16.29; Thu, 10 Nov 2022 17:16: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=eFymu142; 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 S232313AbiKKBOv (ORCPT + 99 others); Thu, 10 Nov 2022 20:14:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231564AbiKKBOI (ORCPT ); Thu, 10 Nov 2022 20:14:08 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 038891571C; Thu, 10 Nov 2022 17:14:05 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 558B2832; Fri, 11 Nov 2022 02:14:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129244; bh=BeljyoRjN1iBTNac4KsCJdbgNEYGLTsNFOjIYlNOmRw=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=eFymu142QGqn7HNxhcwig2AtctJm+24hD6NYd5khxi5tlwIfeymFmcdbh9FcwWXrp je17kdt5aQ9oDut1WpbU8sMCnSe2zu1bNXrj3IllRb0xuZKKFZ5YZa4MBJYzrCHKLv v7pmMrmupx2hp3H0BT9EkdqFD7Iop2wwy7GM5501Euq/gl8hK3+413S0r7fPQOoBq+ myr/D6QiCGyPsrjBvRup8KLfjmGNDiYS1Nm/wLFs5AZSvJ+1ykF7ujz/RjY4JIog82 kpizfHbiuzyxmnBBLkVJbFLtwacLvK1g9AjGxan/4Bp7bzkN7y0oDKV1BPSO6UQzuV ulHxQ2LCRVcrw== Date: Fri, 11 Nov 2022 02:14:03 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v3 06/15] Documentation: remove PG_MAGIC (not a magic number) Message-ID: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160467403193130?= X-GMAIL-MSGID: =?utf-8?q?1749160467403193130?= It's part of the userspace I/O packet protocol. 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 - 4 files changed, 4 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 335169e43be1..62a3a2113e7c 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,7 +68,6 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/pg.h`` APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 699b681088ac..b20a54ee6fb2 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,7 +74,6 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/pg.h`` APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index d1ede86944f1..e7781ab923f7 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,7 +57,6 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/pg.h`` APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 1dd01f1e1c17..5cc0bfa97d9d 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,7 +60,6 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -PG_MAGIC 'P' pg_{read,write}_hdr ``include/linux/pg.h`` APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` From patchwork Fri Nov 11 01:14:13 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: 18360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471173wru; Thu, 10 Nov 2022 17:16:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ryyIgH6bFOlUw2LRkR90Oghb/+yjRr1ykh0SxM++Wzn1MlH8v4d/FAHeaoFx0w1n22xAn X-Received: by 2002:a17:906:7a11:b0:7ad:84c7:502d with SMTP id d17-20020a1709067a1100b007ad84c7502dmr184140ejo.177.1668129395265; Thu, 10 Nov 2022 17:16:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129395; cv=none; d=google.com; s=arc-20160816; b=kZSBVAJo/TggcOa2aN6KHEPbCNjyarHosnDKF0FM1I0ABPrNVR6MOpftAVHLHdYRdf GQKgzqH2+yKkye02QWu50mEqpyzY1/7w9x4yn6R0FNvFnWZRcc6FWjG7bMRtsE6PYFts qQUSz7iSW396vPJsi0cbfsbZM1be9mNXuNDqUUg11mkqzYJWqR+D7//LpN95f+wloYhc IgKrcjVa5PKHlnYacz/BkTW8NXpByWwmgRTniEK8H9tuwHl07Y26E3Cu+IGxHrKhoc2A yJbEorVqihP/378wVnJkGJlHKRVExZoAsuYRbe8aSWQ+AeB51qOMwNkrrN2pW/Cu7OPg KlOQ== 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=1FKE2y8KgZBA4XKj352/JMu0fi19UlzRdQIxJh+XztI=; b=f0HmwCd3FN5etWlABMEncKZUrSiFOqcc9/EpoxHUFimJGOCxVfU6hGCnBfh93NGtK7 5CZd44Jymzx7oik7Z8apyZIoiL6quE7ChV9MGSKo8XQC25xVBVfSSsemT1XJ+7jfMmVf M6oeMiUP5hOgux+SQs08ScomFOOl6HhJMKbSJgbyrCMkStuyyKuovhnbtNtyJku/wLu7 jZDyP1Zv4yWFrZ3fLSOEQqbDssp79q9JhXNMHkwDVF4ROt35uO6XtpaL21xhUI/KlE4k LOlD7eJi/RLnk4D63GYA4bYLXytqi4qLLs3C7Ez1qd00F5sGp/ev0GnsZ2OmFcSaiB/c rppA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=H5X7SzbY; 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 mp36-20020a1709071b2400b00780a882d337si837844ejc.480.2022.11.10.17.16.09; Thu, 10 Nov 2022 17:16:35 -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=H5X7SzbY; 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 S232132AbiKKBPD (ORCPT + 99 others); Thu, 10 Nov 2022 20:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbiKKBOk (ORCPT ); Thu, 10 Nov 2022 20:14:40 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E150163144; Thu, 10 Nov 2022 17:14:14 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 3FA43836; Fri, 11 Nov 2022 02:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129254; bh=kXSsHZTlHF9b19kP2X+sUcjHNG1ZB+xm5Zw8u8gHjFU=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=H5X7SzbYMNYrdUwqB2ywdwXe/+5RW5qTxW0TZew6Xetud7xFKxGHc/6lRz4cWk+3e eM5KbmBBc2hj4+EKtGl9kKGv55tYdCJgSoCbUKa32FyQlWzTFc0lu5/LAxxEKeTzQ8 MZtIPG90Pc5RPWB4HI0lvnnhXQtm1W3YrRidNllNsXmkuH32ebm7akObwYVHl+NoUq OiTgGND8wowRs1nfS7or5U7iPqLAg7h6cRK+FO62SYWcvHFoRu+PdVjihZ7hBDWXzC Xx7/LT9xlv5/NjtqydpKJIVvlpgF9jPgsCma1mfGoQ6yT1JkexSfsP+j0blajAH+Dh 32wqW1+SP/jnw== Date: Fri, 11 Nov 2022 02:14:13 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v3 07/15] Documentation: remove NMI_MAGIC (not a magic number) Message-ID: <9569f3d7700f7f13545be383b12975f9b31c01ae.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160448891946011?= X-GMAIL-MSGID: =?utf-8?q?1749160448891946011?= NMI_MAGIC is part of the firmware API Link: https://lore.kernel.org/all/20221104145002.GA16099@alpha.franken.de/ 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 - 4 files changed, 4 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 62a3a2113e7c..7dada7abc733 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -76,5 +76,4 @@ KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/incl 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`` -NMI_MAGIC 0x48414d4d455201 nmi_s ``arch/mips/include/asm/sn/nmi.h`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index b20a54ee6fb2..f9634a04d349 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -82,5 +82,4 @@ KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/incl 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`` -NMI_MAGIC 0x48414d4d455201 nmi_s ``arch/mips/include/asm/sn/nmi.h`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index e7781ab923f7..966b9e6b1a46 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -65,5 +65,4 @@ KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/incl 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`` -NMI_MAGIC 0x48414d4d455201 nmi_s ``arch/mips/include/asm/sn/nmi.h`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 5cc0bfa97d9d..f3e87a6b3a01 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -68,5 +68,4 @@ KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/incl 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`` -NMI_MAGIC 0x48414d4d455201 nmi_s ``arch/mips/include/asm/sn/nmi.h`` ===================== ================ ======================== ========================================== From patchwork Fri Nov 11 01:14:17 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: 18358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471065wru; Thu, 10 Nov 2022 17:16:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jzGpOVy26V6DM3u+lzYtShhA0zCdHNB9zoJiuQffdmqVwkc2sBRkXRMg4LORUR2yeM6ez X-Received: by 2002:a17:906:79a:b0:73d:715c:5730 with SMTP id l26-20020a170906079a00b0073d715c5730mr163824ejc.293.1668129379177; Thu, 10 Nov 2022 17:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129379; cv=none; d=google.com; s=arc-20160816; b=pofEc1uvpTGyGQv3p789bHjBSDds0eq6qRVTuNBiuW2uGwIGxTKniw/Cde/bTGktyo gDf300zKzMvPZ91ElaHyrxjSq3i/rQmeWwAORCZtwm6dIZ6ZhDmod6EJ1bfLLuKknP+Y IJB9B9hX05KnMKK/Q+p4TxJH/ur8SmHWhFRyG5JmspnbAKaj9Us1+sLnt9JImdZwYRMS u72KKf9URyb0er8bL5SaBKB96RXNFRo2glrmt09GwSUlE0lbvkAjbGNH8HojEwGW4C8A Etyi4k6hmZBjrdS4mSlUZ6KPSUzWFllzZkCW3p3qBJMkVmfQ52MLlQE7VEimG6ZfpjwS vmhg== 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=4l9IsHoO3cD/+7w5NauII7racNmnwxz3VUA4CdxWX5g=; b=BbuEx7F8WY+bQv61O7qIKfvVlNEBfr8L9X9VOzGdDVpeiZoRYn/at8K82EcISSnNea GeOaHkRRgkXkLYlccJzqhcrEvIzSzyL/4MJJ6t/K4cPm5Rswrl8YnsbWWCt85yhQl4t+ N8eYLKEMCqKXHwDWRIypqHEjoxH25en2FhRSCJ8AyREYFFxNWRn0DHZ+T8FUTwUaBSkW onOBSu9N/2/Fa4NBTs0iv1Ub3YtQ8fb7dPL4N/NNFaZmuHySvqlxGAXiRJ1GaYqmnOPM Nk2XwFYvIO+2ey+lrDFvIk4MSKz7AdF5KUwx/9Tf10WfmfyT0LOEAqC8Qga1yO+nmyq/ pz7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=phrgfsvv; 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 sa5-20020a1709076d0500b0078c39937f73si722975ejc.798.2022.11.10.17.15.55; Thu, 10 Nov 2022 17:16:19 -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=phrgfsvv; 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 S232199AbiKKBPI (ORCPT + 99 others); Thu, 10 Nov 2022 20:15:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbiKKBOk (ORCPT ); Thu, 10 Nov 2022 20:14:40 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 701586314C; Thu, 10 Nov 2022 17:14:19 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id C2455512; Fri, 11 Nov 2022 02:14:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129258; bh=Ll41Eia4YFIaHQ+bYX+2DwMFLW+igGoHhF2oNt/mOVY=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=phrgfsvvPcXtLKdt5te5tZODin71YsWa5CHRHjH4lgcbrF1ytnYqeUAq14hgACMl4 mcarQVDoTJhAUdgWD0hAkuzidCyd9vC4f83UeeQkjqHHzC9l4Sr2ap5IQiZhqpbQLj 8E+5kuvDHcgkRW8oR2usVfcKYjMvIJIjfpiJ5GdKy2dEbKBJ7NyiN3llTqhkuOlh9x sBYKfoP4gbd1VPozKajgB3lbNiypQKRYIr2ZLWcA8rHiUW6SKzZMPXmkRD7EKM2IAM hyNVVPDQOn+6d/fYUG1tau17YiAi9j6/gVF7hkHICJAdYr1HyXBSj2HE8raS+AT9TK EtRIuTNutltaA== Date: Fri, 11 Nov 2022 02:14:17 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Thomas Bogendoerfer , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , Bagas Sanjaya , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-mips@vger.kernel.org Subject: [PATCH v3 08/15] MIPS: IP27: remove KV_MAGIC Message-ID: <60f6526fffa99416d2429dfb0b454148170cce8a.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160431990139794?= X-GMAIL-MSGID: =?utf-8?q?1749160431990139794?= It appeared in the original import of SGI code in 2.4.0-test3pre8 and has never been used anywhere. Reviewed-by: Bagas Sanjaya 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 - arch/mips/include/asm/sn/klkernvars.h | 8 ++------ arch/mips/sgi-ip27/ip27-klnuma.c | 1 - 6 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 7dada7abc733..d8ffbc21872e 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -72,7 +72,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`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` -KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` 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 f9634a04d349..0e59704aa617 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -78,7 +78,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`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` -KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` 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 966b9e6b1a46..17a73661ef17 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -61,7 +61,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`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` -KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` 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 f3e87a6b3a01..9d44d49b93bf 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -64,7 +64,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`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` -KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` 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/arch/mips/include/asm/sn/klkernvars.h b/arch/mips/include/asm/sn/klkernvars.h index ea6b21795163..93d5eb873255 100644 --- a/arch/mips/include/asm/sn/klkernvars.h +++ b/arch/mips/include/asm/sn/klkernvars.h @@ -6,18 +6,14 @@ #ifndef __ASM_SN_KLKERNVARS_H #define __ASM_SN_KLKERNVARS_H -#define KV_MAGIC_OFFSET 0x0 -#define KV_RO_NASID_OFFSET 0x4 -#define KV_RW_NASID_OFFSET 0x6 - -#define KV_MAGIC 0x5f4b565f +#define KV_RO_NASID_OFFSET 0x0 +#define KV_RW_NASID_OFFSET 0x2 #ifndef __ASSEMBLY__ #include typedef struct kern_vars_s { - int kv_magic; nasid_t kv_ro_nasid; nasid_t kv_rw_nasid; unsigned long kv_ro_baseaddr; diff --git a/arch/mips/sgi-ip27/ip27-klnuma.c b/arch/mips/sgi-ip27/ip27-klnuma.c index abd7a84df7dd..82bb7ac20ef8 100644 --- a/arch/mips/sgi-ip27/ip27-klnuma.c +++ b/arch/mips/sgi-ip27/ip27-klnuma.c @@ -61,7 +61,6 @@ static __init void set_ktext_source(nasid_t client_nasid, nasid_t server_nasid) KERN_VARS_ADDR(client_nasid) = (unsigned long)kvp; - kvp->kv_magic = KV_MAGIC; kvp->kv_ro_nasid = server_nasid; kvp->kv_rw_nasid = master_nasid; kvp->kv_ro_baseaddr = NODE_CAC_BASE(server_nasid); From patchwork Fri Nov 11 01:14:24 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: 18359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471157wru; Thu, 10 Nov 2022 17:16:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM5pKvQLcxwIXCciiR7TFlp/D8e/8yh5t8JHAKSOEUOKCh5r0zovck5hQ0Ny+40VieFqbq3z X-Received: by 2002:aa7:da4f:0:b0:463:ab06:f338 with SMTP id w15-20020aa7da4f000000b00463ab06f338mr4076404eds.371.1668129391957; Thu, 10 Nov 2022 17:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129391; cv=none; d=google.com; s=arc-20160816; b=vhoafOkDGy8KpahvhmLmR2VFNi+tyNUxTEi4bISjQMbNHXHACMF6TDSQxR3wdN/Pz5 bHpHTXf6BBQDxnWerCxTAd0TJuxCIdIRZP7SyPX9sQEt3I7T0Rzs/2ZcY0kPRkDZ6qAk q1gDr4XYHPaMBwAQ4/9CY0bsMnBr0KKyeDnQdUdnq2Kja8JCHb/Fsi9M1OJteNZG2ULE Wr7UgqD3BPL4czWPrhUnztwlhCeSGH4mXHBSQDeArDx5iomGxCeap3mJzBrD4Jk+QpY1 0oz3M7UFTLpucuQ63mxqqeUN6C0fcG6NmaSoO6fH3W2sA6tJ/uCnCQqpMQB+xvrhWsD5 zMLQ== 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=uI8TKb3LkU8ZIMrfGz9fGaxvRIB8XuniRnuXFqooLyQ=; b=YIjdCLKhcvoHbQOk/gfRbH1cZse0VnIKvChIQQVcFW6ZQ9jtzk658TaKCUjhekE1xd H/veOm9tgmhlWbwTA7XUCvblWXCreEZc3/R6LPxHIC0vuyrJXmeJ20VA2PaFQEy8BTjd IrIKokOXUk8TFCogePcm0f6R+84f13ywCVWcpoUFTc1cTVJkaTDmBAH68CpD871xDSHH lbnubrdrcwlGCdXgGjERF6tPrM7sPhusr0Rsh2Q33f5TN/4hu4SF0j4bmpK5ClDWSFSh Pf2qxBVt9c5MVBVzQFqzay5f97tHbK5ToKaiiHSboWauvK1xkRHWuK3Iki+FOhScY1Jn /bFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=bymImaMa; 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 k20-20020a1709063fd400b0078dcee0cf13si557340ejj.561.2022.11.10.17.16.08; Thu, 10 Nov 2022 17:16:31 -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=bymImaMa; 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 S232324AbiKKBPV (ORCPT + 99 others); Thu, 10 Nov 2022 20:15:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbiKKBOn (ORCPT ); Thu, 10 Nov 2022 20:14:43 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6188163CD8; Thu, 10 Nov 2022 17:14:25 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 4097544E; Fri, 11 Nov 2022 02:14:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129265; bh=nmJaBcatiQbJk2SzOevB7r77S2U4rVv8j6ZH//5Pk1Y=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=bymImaMattby2LwQGeq26vivsLNJfrRqmqb1o9JZZCcVcW9atR8mIq1VsCkKVfUl4 x5zl8YXjwRaGGUdJdwpWUL1H/YSx0JeascSvY+qMR4ODs839gbkS/F8T+NnEjiRC7N o9uxd7q/IyWgiSq/i3Nu0zHzuTcmQkloMCKHAOGZueWBvY0mAVsbpEYmF96Zt1RkJr QI6OFx9ddHMvg0nLO/c9qV9FyiZOpkn8iDKz0jxaCXLj2cX5acf+pCS8Uk1e7yEPtV 2p2H2KTY8N30EfwJiomJcfnoEAiR4P4RL7FWG/7Y3+q4a4PiS0EqtPnmAkafxV3Y1O KoyB7Bs9HMTAQ== Date: Fri, 11 Nov 2022 02:14:24 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jiri Kosina , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Greg Kroah-Hartman , Jakub Kicinski , Jiri Slaby , Kees Cook , Peter Zijlstra , Josh Poimboeuf , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v3 09/15] x86/APM: remove APM_BIOS_MAGIC Message-ID: <8a768ea8f801a0d6b29a064df9096c2ef636859e.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160445193258315?= X-GMAIL-MSGID: =?utf-8?q?1749160445193258315?= We have largely moved away from this approach, and we have better debugging instrumentation 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 - .../translations/it_IT/process/magic-number.rst | 1 - .../translations/zh_CN/process/magic-number.rst | 1 - .../translations/zh_TW/process/magic-number.rst | 1 - arch/x86/kernel/apm_32.c | 9 +-------- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index d8ffbc21872e..77a96a79c7e8 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,7 +68,6 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 0e59704aa617..ef509265a3df 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,7 +74,6 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 17a73661ef17..6437c408dd67 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,7 +57,6 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 9d44d49b93bf..453cc205e6c3 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,7 +60,6 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 60e330cdbd17..f3dd21dc56b7 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -330,7 +330,6 @@ extern int (*console_blank_hook)(int); * The per-file APM data */ struct apm_user { - int magic; struct apm_user *next; unsigned int suser: 1; unsigned int writer: 1; @@ -346,11 +345,6 @@ struct apm_user { apm_event_t events[APM_MAX_EVENTS]; }; -/* - * The magic number in apm_user - */ -#define APM_BIOS_MAGIC 0x4101 - /* * idle percentage above which bios idle calls are done */ @@ -1459,7 +1453,7 @@ static void apm_mainloop(void) static int check_apm_user(struct apm_user *as, const char *func) { - if (as == NULL || as->magic != APM_BIOS_MAGIC) { + if (as == NULL) { pr_err("%s passed bad filp\n", func); return 1; } @@ -1616,7 +1610,6 @@ static int do_open(struct inode *inode, struct file *filp) if (as == NULL) return -ENOMEM; - as->magic = APM_BIOS_MAGIC; as->event_tail = as->event_head = 0; as->suspends_pending = as->standbys_pending = 0; as->suspends_read = as->standbys_read = 0; From patchwork Fri Nov 11 01:14:29 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: 18361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471186wru; Thu, 10 Nov 2022 17:16:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KTPUD5Sa2CmTg9wuRlW9q9HtRnpIS4iiAhmwi/APF/YA1kTzS0qwVKrMgHJbQ0fBHrU+m X-Received: by 2002:a17:907:962a:b0:7ae:39b4:7208 with SMTP id gb42-20020a170907962a00b007ae39b47208mr93571ejc.766.1668129397575; Thu, 10 Nov 2022 17:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129397; cv=none; d=google.com; s=arc-20160816; b=ZLqZoBBNkOaRqc4XzdD9rgDrWyJrt3UYpcsXrV0d++7wrg7WiC6ZErh+rV7fYF8w9Q G1uvUQ/c9ul+0qZZxSPW2D4cuj+u1kNtCK1ZQoMLZL0ibnP/uYFzft7qq2VOoPtIkggb wTV3hu11RrHTRtS6SHq+oCa/mnXQTTAleoArNXoRF0ztGbzsTdT8Vvcj+88+nXbK9A6+ RtykG/ffSEnr1Obg9mj/8E8XZyfif/kjqV8XWDFT22hGsM4KUKnr6Quoka5rK0ZzKYUG s9GGVJfH3xkYv5e/kA1auZORGu14PaRY5tWwtckRWhS+A8YeiskTtY4dFQmZhlbd52i2 5www== 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=Ij7MBMGRuJqfoxRwH5h5oO0PULb18qKrbYq+HdwnclE=; b=pxv4ce6tJIIAPsxC4/OkTw3PXfNa6674AsAcoJhMsSzMZE4e2Ghp/WZkUpxqlUbQtV S5jPoTcK2cUmy92s7iU6+PRps52RJrmBUcNKgAReU41qsnoMIx+ow4T/2EArjGQWzIKn 7clXGjy6Qp2Pfjof4fvIHiSSGEXL9a1XFUzVlGX+BRez3fK6Y5Ru87gC9RRlbWSZE0sr 2SshZj/WtecqK34JJ8mIlldXJvjgoK9Y1k0zUAZzP+N3WCOVNp4/7gJXHFxHxe3YmeLK TeqaOdkrmyhr51+5I+uqqn75mLiok8vqEaiZdAaTe8WN6ksppqsaRr1MoMk59oR+XMed jxnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=t2icKf2U; 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 a3-20020a50c303000000b00463817b0ba1si933810edb.163.2022.11.10.17.16.13; Thu, 10 Nov 2022 17:16:37 -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=t2icKf2U; 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 S229547AbiKKBPj (ORCPT + 99 others); Thu, 10 Nov 2022 20:15:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbiKKBO6 (ORCPT ); Thu, 10 Nov 2022 20:14:58 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2812414016; Thu, 10 Nov 2022 17:14:30 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 1BA1A450; Fri, 11 Nov 2022 02:14:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129270; bh=iMPtb8qACfC1PCFMoSnSmABFq0REu+ki/WXYNsR3gJU=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=t2icKf2Ugagh1j+0i+rwTAU6ZYCKGC6SDiXzex29FoPzql0KaRHR2kIC0OHE/j2FD tLcBYfFOnGcRSULDSAKioJ0C2OMe9gRLbta6MKusbK7dQ3dFS49qE3rEp94dZwRDzS /WFDjfLXMZOa+XbTrVmZiEHch0MPbZiJS4owyiLJabTPrQwyYN8WRgNZJjQ48tduai XrOFGF1aNHcpoZM+oFlWXeg8xJaPVtThoH98wHzJuNXeZlNl0aLMX9lWAfqBFxsFNs +yuEZBfjVYvibiicoFkUNHG7OFjGE1AVSR/JWuUKP54R5eJA/WSYUb8i6WkaSDPCZg 7ub0Dzc6CmzWw== Date: Fri, 11 Nov 2022 02:14:29 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Russell King , "James E.J. Bottomley" , "Martin K. Petersen" , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-scsi@vger.kernel.org Subject: [PATCH v3 10/15] scsi: acorn: remove QUEUE_MAGIC_{FREE,USED} Message-ID: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160451098592202?= X-GMAIL-MSGID: =?utf-8?q?1749160451098592202?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 2 -- .../it_IT/process/magic-number.rst | 2 -- .../zh_CN/process/magic-number.rst | 2 -- .../zh_TW/process/magic-number.rst | 2 -- drivers/scsi/arm/queue.c | 21 ------------------- 5 files changed, 29 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 77a96a79c7e8..c1c68c713cbc 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -72,6 +72,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` 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 ef509265a3df..5b609ca78a14 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -78,6 +78,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` 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 6437c408dd67..ab4d4e32b61f 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -61,6 +61,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` 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 453cc205e6c3..a6131d978189 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -64,6 +64,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/ SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` 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/scsi/arm/queue.c b/drivers/scsi/arm/queue.c index 978df23ce188..fe7d814a73a9 100644 --- a/drivers/scsi/arm/queue.c +++ b/drivers/scsi/arm/queue.c @@ -26,27 +26,11 @@ #include #include -#define DEBUG - typedef struct queue_entry { struct list_head list; struct scsi_cmnd *SCpnt; -#ifdef DEBUG - unsigned long magic; -#endif } QE_t; -#ifdef DEBUG -#define QUEUE_MAGIC_FREE 0xf7e1c9a3 -#define QUEUE_MAGIC_USED 0xf7e1cc33 - -#define SET_MAGIC(q,m) ((q)->magic = (m)) -#define BAD_MAGIC(q,m) ((q)->magic != (m)) -#else -#define SET_MAGIC(q,m) do { } while (0) -#define BAD_MAGIC(q,m) (0) -#endif - #include "queue.h" #define NR_QE 32 @@ -74,7 +58,6 @@ int queue_initialise (Queue_t *queue) queue->alloc = q = kmalloc_array(nqueues, sizeof(QE_t), GFP_KERNEL); if (q) { for (; nqueues; q++, nqueues--) { - SET_MAGIC(q, QUEUE_MAGIC_FREE); q->SCpnt = NULL; list_add(&q->list, &queue->free); } @@ -119,9 +102,7 @@ int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) list_del(l); q = list_entry(l, QE_t, list); - BUG_ON(BAD_MAGIC(q, QUEUE_MAGIC_FREE)); - SET_MAGIC(q, QUEUE_MAGIC_USED); q->SCpnt = SCpnt; if (head) @@ -144,9 +125,7 @@ static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) */ list_del(ent); q = list_entry(ent, QE_t, list); - BUG_ON(BAD_MAGIC(q, QUEUE_MAGIC_USED)); - SET_MAGIC(q, QUEUE_MAGIC_FREE); list_add(ent, &queue->free); return q->SCpnt; From patchwork Fri Nov 11 01:14:33 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: 18362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471244wru; Thu, 10 Nov 2022 17:16:48 -0800 (PST) X-Google-Smtp-Source: AMsMyM7rQBDdD2Boivz4ZgCDYlgNWc8dhIF+uf0dUzdRxZU7oSfrfRo6nN74T2D/acPK311bMB7c X-Received: by 2002:aa7:c68b:0:b0:461:c6e8:452e with SMTP id n11-20020aa7c68b000000b00461c6e8452emr3990956edq.298.1668129407915; Thu, 10 Nov 2022 17:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129407; cv=none; d=google.com; s=arc-20160816; b=RXbpVUFEgzHYdTW3d2vvRgFVEDEtXbzDZZFzgmjLfEpTJOaHcoHx2Zo5m2eInfnN/g 5zzZmq2pPrLtdVUASPrI6SoEo06ftIXeKbRFcr8R2z65sgtERsngOYTXlOh7V/Kr7ZW1 tThqXoGO0gspErdS6sN50tVlgeJ3bVQ8ENb7aKQITIss/vO4F6MwyCy1/3Y0KicyRHgp +OV9lCxe6spgXE1/AsLWWoCZ4RcR4x1mmOeckS4gDqCReH2Y6BPEIrES/9OXfM9gHyUD JMzzNdHpuRrzJ/oXO0h0S3LQ7+5YIcSdZo0y1SNAm4igIQYD8euJw0TJ54KHHreFFtiJ Nbfw== 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=oO3vSju5cLDRgO+lCvCfbENsEmf+aIce5zak1VuzmW8=; b=093ocz23qQ1M04ogTyeYD0hJ7OC1sZBxWs6fMXR7+qJCGfsXOk6cOJrGFptamFHUJG bn70w81gVopzdUF8iHJPJf7LRLdqqkZga87qDgFrJFL2Unm8rID6nVlhkObL/1zPSK/M c1Yp8wVbF0dOka3NLu/e+qJ2u4BteAlkV+CTUhPAjninthNyOF4IeQcrzTJztbQeG1KG rGtg9AIbieM+4n+W0vjvNP9NWiOfE+C9Kmrvy5AxNIfIFRdsF1y4I/yDvR1hLsEQNskE LzCuCMXo3+emDGyoxvai4z8ZBY6WVds96ZenRtRfm4+/0pgaoFXa7JAiu9huSGt+YyOS OTaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=eFoPT6Ta; 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 o7-20020a056402038700b004612915d1a0si811768edv.507.2022.11.10.17.16.23; Thu, 10 Nov 2022 17:16:47 -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=eFoPT6Ta; 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 S232506AbiKKBPr (ORCPT + 99 others); Thu, 10 Nov 2022 20:15:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232111AbiKKBPB (ORCPT ); Thu, 10 Nov 2022 20:15:01 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 24EA964A0E; Thu, 10 Nov 2022 17:14:35 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 739CB740; Fri, 11 Nov 2022 02:14:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129274; bh=Be1Pxakq207nlXxpQ89ncdamlPosjQkgXJViXRRlV10=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=eFoPT6Tau6WfPDeDdofL7X3GpraEEXez1hwa7ZE0Vq2fveMN6hCDcIIYxnLqh+UyX w8738D+TMvGM1TCxFto5oEKbCx0JFBCXPGh0uiwaE6eI+iyKt1NXU0aQ2GyWIsIO/0 fzVbXmiXOJhwWI9TEoOiHYQVIA/NMqMqPNA/oTA8Gem4PbOp+bgOG/rRsqi/4xrzKn mNBq+1f0qr+j7Y7/nv+wNsVTTRE2gBcVPzhJi4QlcCrrPFjaoTIuKJ0tUfZ3J95fIp iRDq4/nr5O0nkCEDI0OUInPREqnCcHyrFjH1rWNTH/xMYqaITUjcVnTPrRBXKAXeuq 1ylH8h88He7PA== Date: Fri, 11 Nov 2022 02:14:33 +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 , Marc Kleine-Budde , "Jason A. Donenfeld" , Kees Cook , Wolfram Sang , 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 11/15] hdlcdrv: remove HDLCDRV_MAGIC Message-ID: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160461970731294?= X-GMAIL-MSGID: =?utf-8?q?1749160461970731294?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Additionally, ~half HDLCDRV_MAGIC checks just early-exit instead of noting the bug, so they're detrimental, if anything. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Acked-by: Jakub Kicinski 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_par.c | 1 - drivers/net/hamradio/baycom_ser_fdx.c | 3 +-- drivers/net/hamradio/baycom_ser_hdx.c | 3 +-- drivers/net/hamradio/hdlcdrv.c | 9 +++------ include/linux/hdlcdrv.h | 2 -- 9 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index c1c68c713cbc..3b3e607e1cbc 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -70,6 +70,5 @@ Magic Name Number Structure File ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` -HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 5b609ca78a14..e8c659b6a743 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -76,6 +76,5 @@ Nome magico Numero Struttura File ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` -HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index ab4d4e32b61f..2105af32187c 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -59,6 +59,5 @@ Linux 魔术数 ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` -HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index a6131d978189..793a0ae9fb7c 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -62,6 +62,5 @@ Linux 魔術數 ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` -HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c index fd7da5bb1fa5..e1cf3ed42df6 100644 --- a/drivers/net/hamradio/baycom_par.c +++ b/drivers/net/hamradio/baycom_par.c @@ -418,7 +418,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data, return -EINVAL; bc = netdev_priv(dev); - BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC); if (cmd != SIOCDEVPRIVATE) return -ENOIOCTLCMD; diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index 646f605e358f..65113cb6de8d 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c @@ -252,7 +252,7 @@ static irqreturn_t ser12_interrupt(int irq, void *dev_id) unsigned char iir, msr; unsigned int txcount = 0; - if (!bc || bc->hdrv.magic != HDLCDRV_MAGIC) + if (!bc) return IRQ_NONE; /* fast way out for shared irq */ if ((iir = inb(IIR(dev->base_addr))) & 1) @@ -507,7 +507,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data, return -EINVAL; bc = netdev_priv(dev); - BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC); if (cmd != SIOCDEVPRIVATE) return -ENOIOCTLCMD; diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c index 5d1ab4840753..df33e5cdb5c2 100644 --- a/drivers/net/hamradio/baycom_ser_hdx.c +++ b/drivers/net/hamradio/baycom_ser_hdx.c @@ -365,7 +365,7 @@ static irqreturn_t ser12_interrupt(int irq, void *dev_id) struct baycom_state *bc = netdev_priv(dev); unsigned char iir; - if (!dev || !bc || bc->hdrv.magic != HDLCDRV_MAGIC) + if (!dev || !bc) return IRQ_NONE; /* fast way out */ if ((iir = inb(IIR(dev->base_addr))) & 1) @@ -561,7 +561,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data, return -EINVAL; bc = netdev_priv(dev); - BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC); if (cmd != SIOCDEVPRIVATE) return -ENOIOCTLCMD; diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 2263029d1a20..60abd6008cc7 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c @@ -158,7 +158,7 @@ void hdlcdrv_receiver(struct net_device *dev, struct hdlcdrv_state *s) int i; unsigned int mask1, mask2, mask3, mask4, mask5, mask6, word; - if (!s || s->magic != HDLCDRV_MAGIC) + if (!s) return; if (test_and_set_bit(0, &s->hdlcrx.in_hdlc_rx)) return; @@ -257,7 +257,7 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s) struct sk_buff *skb; int pkt_len; - if (!s || s->magic != HDLCDRV_MAGIC) + if (!s) return; if (test_and_set_bit(0, &s->hdlctx.in_hdlc_tx)) return; @@ -364,7 +364,7 @@ static void start_tx(struct net_device *dev, struct hdlcdrv_state *s) void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) { - if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) + if (!s || s->hdlctx.ptt || !s->skb) return; if (s->ch_params.fulldup) { start_tx(dev, s); @@ -701,7 +701,6 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, * initialize part of the hdlcdrv_state struct */ s = netdev_priv(dev); - s->magic = HDLCDRV_MAGIC; s->ops = ops; dev->base_addr = baseaddr; dev->irq = irq; @@ -723,8 +722,6 @@ void hdlcdrv_unregister(struct net_device *dev) { struct hdlcdrv_state *s = netdev_priv(dev); - BUG_ON(s->magic != HDLCDRV_MAGIC); - if (s->opened && s->ops->close) s->ops->close(dev); unregister_netdev(dev); diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index 5d70c3f98f5b..809ad0f5c99c 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -13,7 +13,6 @@ #include #include -#define HDLCDRV_MAGIC 0x5ac6e778 #define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */ #define HDLCDRV_BITBUFFER 256 /* should be a power of 2 for speed reasons */ #undef HDLCDRV_LOOPBACK /* define for HDLC debugging purposes */ @@ -84,7 +83,6 @@ struct hdlcdrv_ops { }; struct hdlcdrv_state { - int magic; int opened; const struct hdlcdrv_ops *ops; From patchwork Fri Nov 11 01:14:38 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: 18365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp471754wru; Thu, 10 Nov 2022 17:18:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cveHW+szguXl3H1hkLf77lt96ldD+tAusMIZ2XYBTorrN0F9l66fTQ3iq2lUTtdMBSEcA X-Received: by 2002:a17:906:414d:b0:781:951:2fb with SMTP id l13-20020a170906414d00b00781095102fbmr209055ejk.64.1668129502633; Thu, 10 Nov 2022 17:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129502; cv=none; d=google.com; s=arc-20160816; b=Yby9F7pqR0saMFRWD2RmxN1xphI/fYkE4uKEE+n7LmtfUJflQt7JbADKscgcJX+Ypv WXppgZdKzyeg95273Bf1GKY3tgW6+BqKRW9oFb0fdnY7m5B9XuDNO7etxDy4r54XXv8q wL6LPsfN7aq8nSgW1sL1GZvmR/Jj/+/ZjvknycMuVpqTMF3fNELYRaYbsGSnWNNgXoQY bVnhhT6RJ40knAK6RtvIQvo3wEj2dYh0vDiCYzhhFHF6SAD/zp0zNKADwcD8c5auSSso /jasEzTpDc2xXk1Tph/RIERc/TW9wg1cIvjz0Z/uNa5oNQP2hmoGte4Kv4PGlwMtytEL NviA== 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=0hJrTIOc2WF2P2iyR0z5OdoygoMj5b8zq/BS1mpMd8g=; b=FXKxFX7VW3OcFfZVQ5OaA5lQzP+RsIKHNXyvoBoLvhMF0aV9WNSk/Q84HUBmB58fLj SHvsIEByiN4FHsjpqsNgvOEqpJRCxa12RRsBFkw3Wvk5rTsOFVss5zfHrsodOJdF+P0R 9ZDz4yNJIqZGnF55jJtBTLV3rHWrE7A16hjwb9/hVkvxN0UYyamZpTyKY9J1HNYunfYQ KO+uATjLAcfekulu7f5JQF9iFs/FUTxzc6Yv54RXMtZAJQLxsUwjeFA6DNm7V41ecEL8 CFbVGOQUWhepZRCCVnOvbgHDTtpD0K+tas/3NfT+mGxzI5/H2TFG3iRo6L6REfwGn7DH l3PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=LoOr1h5I; 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 e7-20020a170906844700b00782539a0286si592331ejy.142.2022.11.10.17.17.58; Thu, 10 Nov 2022 17:18:22 -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=LoOr1h5I; 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 S232532AbiKKBQH (ORCPT + 99 others); Thu, 10 Nov 2022 20:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbiKKBPP (ORCPT ); Thu, 10 Nov 2022 20:15:15 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75B002124C; Thu, 10 Nov 2022 17:14:40 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id C64A8452; Fri, 11 Nov 2022 02:14:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129279; bh=XRnEX2VezQMkuazgxD7F8iFgqKQr9+bZpaNouakmEn4=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=LoOr1h5IxF2I5nvfVnHWo1iw273I5Po3fHa1P7xCk5EA0g2b48QrUQJzChJVVQjvj 75guOspF4pBnL3khWq7Na/Vye65srHFSgNs+4VrQYbjJMvwCrZFF7VxliDNjvE6a+I 5rGAfWL5BH8T7RX0TKtRGOKVrcJYxkqD+1gYwHTZirHOG/HSlc/EE96esqbruDZrpn Ft6+M61tZ+P1Ps1tyNdQfYEbDo4i3Bl/owITyxyDYdr7m6CqNj7usMwkOhGgJ1h9au tWxo57/wAGXRdNXJ+aFm/GENBSYsCK5LfsK09ULo1AkEuzwWqkkMUvPIjtyWNL3xb2 84hhtoBc1mr+Q== Date: Fri, 11 Nov 2022 02:14:38 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , Oliver Hartkopp , Sebastian Andrzej Siewior , Marc Kleine-Budde , Duoming Zhou , Huang Pei , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH v3 12/15] drivers: net: slip: remove SLIP_MAGIC Message-ID: <570435f7a54ff9fbb55a7e970ae8f082b88a6454.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160561121582158?= X-GMAIL-MSGID: =?utf-8?q?1749160561121582158?= According to Greg, in the context of magic numbers as defined in magic-number.rst, "the tty layer should not need this and I'll gladly take patches". We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Additionally, all SLIP_MAGIC checks just early-exit instead of noting the bug, so they're detrimental, if anything. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Reviewed-by: Oliver Hartkopp Acked-by: Jakub Kicinski 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/slip/slip.c | 11 +++++------ drivers/net/slip/slip.h | 4 ---- 6 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 3b3e607e1cbc..e59c707ec785 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -69,6 +69,5 @@ Changelog:: Magic Name Number Structure File ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` -SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index e8c659b6a743..37a539867b6f 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -75,6 +75,5 @@ Registro dei cambiamenti:: Nome magico Numero Struttura File ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` -SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 2105af32187c..8a3a3e872c52 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -58,6 +58,5 @@ Linux 魔术数 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` -SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 793a0ae9fb7c..7ace7834f7f9 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -61,6 +61,5 @@ Linux 魔術數 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` -SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index 6865d32270e5..95f5c79772e7 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c @@ -426,7 +426,7 @@ static void slip_transmit(struct work_struct *work) spin_lock_bh(&sl->lock); /* First make sure we're connected. */ - if (!sl->tty || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) { + if (!sl->tty || !netif_running(sl->dev)) { spin_unlock_bh(&sl->lock); return; } @@ -690,7 +690,7 @@ static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp, { struct slip *sl = tty->disc_data; - if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) + if (!sl || !netif_running(sl->dev)) return; /* Read the characters out of the buffer */ @@ -761,7 +761,6 @@ static struct slip *sl_alloc(void) sl = netdev_priv(dev); /* Initialize channel control data */ - sl->magic = SLIP_MAGIC; sl->dev = dev; spin_lock_init(&sl->lock); INIT_WORK(&sl->tx_work, slip_transmit); @@ -809,7 +808,7 @@ static int slip_open(struct tty_struct *tty) err = -EEXIST; /* First make sure we're not already connected. */ - if (sl && sl->magic == SLIP_MAGIC) + if (sl) goto err_exit; /* OK. Find a free SLIP channel to use. */ @@ -886,7 +885,7 @@ static void slip_close(struct tty_struct *tty) struct slip *sl = tty->disc_data; /* First make sure we're connected. */ - if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty) + if (!sl || sl->tty != tty) return; spin_lock_bh(&sl->lock); @@ -1080,7 +1079,7 @@ static int slip_ioctl(struct tty_struct *tty, unsigned int cmd, int __user *p = (int __user *)arg; /* First make sure we're connected. */ - if (!sl || sl->magic != SLIP_MAGIC) + if (!sl) return -EINVAL; switch (cmd) { diff --git a/drivers/net/slip/slip.h b/drivers/net/slip/slip.h index 3d7f88b330c1..d7dbedd27669 100644 --- a/drivers/net/slip/slip.h +++ b/drivers/net/slip/slip.h @@ -50,8 +50,6 @@ struct slip { - int magic; - /* Various fields. */ struct tty_struct *tty; /* ptr to TTY structure */ struct net_device *dev; /* easy for intr handling */ @@ -100,6 +98,4 @@ struct slip { #endif }; -#define SLIP_MAGIC 0x5302 - #endif /* _LINUX_SLIP.H */ From patchwork Fri Nov 11 01:14: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: 18366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp472269wru; Thu, 10 Nov 2022 17:19:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cgvqOEliozcjAQNHfcAR379BF12ZxltXPO6XRDMOuavaEZU+BHnKJE2B7aJcOKDpavyyy X-Received: by 2002:a17:906:abc6:b0:7ac:db50:90ed with SMTP id kq6-20020a170906abc600b007acdb5090edmr140771ejb.487.1668129586361; Thu, 10 Nov 2022 17:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129586; cv=none; d=google.com; s=arc-20160816; b=NcSTK6QwxTlCP9pPKviQNTWwZd8CUOQO8IO+XkQbr4yZse16bK0oQQVD2SE6uphrrk XijVbIAImjU/k7ftlpvBbjymnOZI9FfpX3L1clwcskrpd5+8KRq7/XZVoCeLP8FmPDt3 9wQOQoCq1ysUm5xky9DLln2RRjHI8gwMhIzZK5ir4OPUMBBtJ0Kx49GUlA7x/eqWlQna 8/X+gGfKG6i4IfdoIS3B81JhB2zh04Uv3luul7MpH34DOWAmpO9OeY0/q3n6Oz510FBr igiCbkwgbOxXaGrv/c+L5ZgEB/x5F9YBKx1S2VcdXGcMcCNNn9EaPy0WPfhvvRY5VecT Pv7A== 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=qjqtT2R7xLTIplhCfr+LWhhro5JbQiRSfLEdMLrKV30=; b=TTi5GYlsVuqyNlQDsf9ARF7ZAlz2oi5T+UntowxTZtKoHgK47mAlD5BxZSkmNdrUBs C0F9Gc9J03mhxC7CPSm9SLGzQAoVayWAptYcAQdaO1snSrJWEkjOB3CZQ0ckbfhFuOOb 1p95vIS4BsWrQfnsrnqnznIzSIMfuUkcl93wbnkkmw2iWPu+LSgAAi8LZ22Q3UGTgJI3 AdXKUhjzuv6jslz6tp7Mtrofs9dueGeohEHbRIKWeAXrDLEqunS5+NWvrmHO2KprfiBu /n26CUc40tkv2Tay20psRTUnZo0ibyrTgfmEPEMgr3YpGef5ewcNTotyl5mUDr7Amm+7 eD6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b="bwTSyNh/"; 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 wu10-20020a170906eeca00b0078dcdbb3e87si690106ejb.530.2022.11.10.17.19.23; Thu, 10 Nov 2022 17:19:46 -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="bwTSyNh/"; 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 S232431AbiKKBQN (ORCPT + 99 others); Thu, 10 Nov 2022 20:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbiKKBPT (ORCPT ); Thu, 10 Nov 2022 20:15:19 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BDC3D27FDB; Thu, 10 Nov 2022 17:14:44 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 1B69E454; Fri, 11 Nov 2022 02:14:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129284; bh=MoO/mUS5QNTMdZjDy+3p1P3o4Hu+RTNLEIKcnT/Qc4M=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=bwTSyNh/k3T4mHiVjl8qy7gY/YvacL9rTyoGH4wcsDXjKeT2P98D43lFDh22tJSCv 8Wrjii10haT2EvB1m7M4gGm9Sym/ULurTisyxMHoUdk/brts8x2Zg0vbSuoY4XdE56 yQNz+1Sj0rb3WfvkdyZtERrUHAj/Y+PYFd5KP3QwVg2Rp7dIhcNnfDEJ8RZocP+oF6 l/cCJWJKDy53gF+VSxABsfr3r8ij2n/TG4xtf8mVltUYBPRoY6BfsiEdlK9+OEPwF7 6mPSSyQ1NdHTr48J7kmcqnpyj7T0xQgJZQdI1f/bA5qlVV9/wCfwmndz8YyPVvR6id +ZoVJXnHshBdw== Date: Fri, 11 Nov 2022 02:14:43 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jeff Layton , Chuck Lever , Alexander Viro , Greg Kroah-Hartman , Jakub Kicinski , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH v3 13/15] fcntl: remove FASYNC_MAGIC Message-ID: <756e6016fab23e95d891b6284fbf52184135ee46.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160649113919840?= X-GMAIL-MSGID: =?utf-8?q?1749160649113919840?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska Reviewed-by: Jeff Layton --- 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 - fs/fcntl.c | 6 ------ include/linux/fs.h | 3 --- 6 files changed, 13 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index e59c707ec785..6e432917a5a8 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,6 +68,5 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 37a539867b6f..7d4c117ac626 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,6 +74,5 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 8a3a3e872c52..c17e3f20440a 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,6 +57,5 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 7ace7834f7f9..e2eeb74e7192 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,6 +60,5 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/fs/fcntl.c b/fs/fcntl.c index 146c9ab0cd4b..e366a3804108 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -924,7 +924,6 @@ struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasy } rwlock_init(&new->fa_lock); - new->magic = FASYNC_MAGIC; new->fa_file = filp; new->fa_fd = fd; new->fa_next = *fapp; @@ -988,11 +987,6 @@ static void kill_fasync_rcu(struct fasync_struct *fa, int sig, int band) struct fown_struct *fown; unsigned long flags; - if (fa->magic != FASYNC_MAGIC) { - printk(KERN_ERR "kill_fasync: bad magic number in " - "fasync_struct!\n"); - return; - } read_lock_irqsave(&fa->fa_lock, flags); if (fa->fa_file) { fown = &fa->fa_file->f_owner; diff --git a/include/linux/fs.h b/include/linux/fs.h index e654435f1651..acfd5db5341a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1345,15 +1345,12 @@ static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) struct fasync_struct { rwlock_t fa_lock; - int magic; int fa_fd; struct fasync_struct *fa_next; /* singly linked list */ struct file *fa_file; struct rcu_head fa_rcu; }; -#define FASYNC_MAGIC 0x4601 - /* SMP safe fasync helpers: */ extern int fasync_helper(int, struct file *, int, struct fasync_struct **); extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *); From patchwork Fri Nov 11 01:14:47 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: 18367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp472330wru; Thu, 10 Nov 2022 17:19:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tQB3phKRtgoFlEwWCLZBd6I/6T5oM/vac3CV+RADYeQa2mLwk1grWFBYQnRg++9PWCfCH X-Received: by 2002:a17:906:b1cd:b0:7ae:732d:bc51 with SMTP id bv13-20020a170906b1cd00b007ae732dbc51mr133588ejb.549.1668129595531; Thu, 10 Nov 2022 17:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129595; cv=none; d=google.com; s=arc-20160816; b=NJD6rhEBORMCPQzd5zHsnD8FgkXa057rXoGfKaP6mcvIjk/bYF0V/a8ZT/vnxGXBI7 L/puFxm6tItfkkFmOnDmJv+Hc2lEx2uYr3vZTg5U/L9uppg/7kLGp7KUph21IWTmpIVr WCJJl/l0fs+yljBU0ybHE1WUEGt8/WSSUiYgTI4EMBDlDwDWIEFxIdCjk/WbmyHggYX2 q2w8JkkZ81pZCtc0yU1vU4SaXwj3pCGpNkSabRGhkctLVpHnUUsQ5K7ErW7kWcYRG76O g4qx8sXWhr8NYdgQcbhuSh0BQuU6IhWtPtGD1JCBI5cv//dBVwcA9P3PwTYAF7G0ZGC1 R6nA== 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=TGd32QjgRVeBdTySjyB5ivnd3jru1IFkoDD8PTZ3E+U=; b=LqCxs630E3i8Dhq6zk6TFaggBFiBmEF/TFhwLxe4CNcHoVNuZZqzIHS9/XXb0YP7TZ Bh+Iepf5fl5ZP62BoQdxmFgXJhMQuNF3cZfs4B5whhzjlt58k7TMoruF3igzWyHks1M8 X0pi9XnNqSmM0EitPQce3lL6LsAe0OCFtWD9rXEgO55bqRKUNQJDviK9AayNaxDjLD5Y W0A9UWZwZ5lXgbwsZXF38uOfiv5rxkoxvfZ/SNCmabgo8rgHZ3qWFnfqooyny2xWpWE3 7TtczguSeLT7nKremM73vzvTL4GbGMlIKrWHuxllXAJEigC9+iUEWQxnXRQzxRaENz+2 azNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=AgogrmAV; 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 la26-20020a170907781a00b007ae814af66bsi605664ejc.389.2022.11.10.17.19.32; Thu, 10 Nov 2022 17:19:55 -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=AgogrmAV; 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 S232343AbiKKBQQ (ORCPT + 99 others); Thu, 10 Nov 2022 20:16:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232273AbiKKBPU (ORCPT ); Thu, 10 Nov 2022 20:15:20 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F0BA4165B4; Thu, 10 Nov 2022 17:14:48 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 4CCF6456; Fri, 11 Nov 2022 02:14:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129288; bh=QQcVqdOIas77625N9ryGqV0AYz/xIDRwp/LEjV3tj0k=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=AgogrmAVSGIQTQaEqN1R6KcRHReJy3t+0kIVk0CivXO0UQYdSy2Yjh3+NHs9o4bdH ydsXG7g04tMLm035pJwjj1Yy+Fwcy0MX/njfcsvumOxIavfwu/X0dLO8v2eSGYZ+GE Ji/smVBKbF6LK9b7Eg/u+5wxstiYkfqZa4VJVtrQsX7mJ1S9ByzVmHnmiRLj+xnr67 Nf5t8CUeq4ifjk0KKJ5ORg26JuNM1181wHW5jAwl8b0wVuiWkOoRo/7lwdX0AgIW93 9Ei3axHbOo40KIw8v0S5dYiSRbV5U7v/bcdYVwoGCbdhbQsRekvTrcDVHZ+Z4fpMwH KIs/HoBiiFjbg== Date: Fri, 11 Nov 2022 02:14:47 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , "James E.J. Bottomley" , "Martin K. Petersen" , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-scsi@vger.kernel.org Subject: [PATCH v3 14/15] scsi: ncr53c8xx: replace CCB_MAGIC with bool busy Message-ID: <7c5854769df2af955e991baf02b88fd0d84502d0.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160658896679230?= X-GMAIL-MSGID: =?utf-8?q?1749160658896679230?= The only non-boolean check might as well be, since it just early-exits instead of noting the bug: lower it to a boolean and make it less confusing. As for magic numbers, we have largely moved away from this approach, and we have better debugging instrumentation 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 - .../it_IT/process/magic-number.rst | 1 - .../zh_CN/process/magic-number.rst | 1 - .../zh_TW/process/magic-number.rst | 1 - drivers/scsi/ncr53c8xx.c | 25 ++++++------------- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 6e432917a5a8..5a8c2755ac9c 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,5 +68,4 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 7d4c117ac626..2fbc1876534a 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,5 +74,4 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index c17e3f20440a..f8ec4767bc4e 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,5 +57,4 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index e2eeb74e7192..0ccc60bee3d6 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,5 +60,4 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 4458449c960b..928417fca495 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -1095,15 +1095,6 @@ typedef u32 tagmap_t; #define NS_WIDE (2) #define NS_PPR (4) -/*========================================================== -** -** Misc. -** -**========================================================== -*/ - -#define CCB_MAGIC (0xf2691ad2) - /*========================================================== ** ** Declaration of structs. @@ -1567,7 +1558,7 @@ struct ccb { struct ccb * link_ccb; /* Host adapter CCB chain */ struct list_head link_ccbq; /* Link to unit CCB queue */ u32 startp; /* Initial data pointer */ - u_long magic; /* Free / busy CCB flag */ + bool busy; }; #define CCB_PHYS(cp,lbl) (cp->p_ccb + offsetof(struct ccb, lbl)) @@ -4356,7 +4347,7 @@ static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd) */ /* activate this job. */ - cp->magic = CCB_MAGIC; + cp->busy = true; /* ** insert next CCBs into start queue. @@ -4667,7 +4658,7 @@ void ncr_complete (struct ncb *np, struct ccb *cp) ** Sanity check */ - if (!cp || cp->magic != CCB_MAGIC || !cp->cmd) + if (!cp || !cp->busy || !cp->cmd) return; /* @@ -6998,7 +6989,7 @@ static struct ccb *ncr_get_ccb(struct ncb *np, struct scsi_cmnd *cmd) qp = ncr_list_pop(&lp->free_ccbq); if (qp) { cp = list_entry(qp, struct ccb, link_ccbq); - if (cp->magic) { + if (cp->busy) { PRINT_ADDR(cmd, "ccb free list corrupted " "(@%p)\n", cp); cp = NULL; @@ -7030,17 +7021,17 @@ static struct ccb *ncr_get_ccb(struct ncb *np, struct scsi_cmnd *cmd) ** Wait until available. */ #if 0 - while (cp->magic) { + while (cp->busy) { if (flags & SCSI_NOSLEEP) break; if (tsleep ((caddr_t)cp, PRIBIO|PCATCH, "ncr", 0)) break; } #endif - if (cp->magic) + if (cp->busy) return NULL; - cp->magic = 1; + cp->busy = true; /* ** Move to next available tag if tag used. @@ -7119,7 +7110,7 @@ static void ncr_free_ccb (struct ncb *np, struct ccb *cp) } } cp -> host_status = HS_IDLE; - cp -> magic = 0; + cp -> busy = false; if (cp->queued) { --np->queuedccbs; cp->queued = 0; From patchwork Fri Nov 11 01:14:52 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: 18368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp472383wru; Thu, 10 Nov 2022 17:20:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf54M4Ucsl3Hd+7mij+ui8/AeoOvXK/59Y+rEypy+jeAaSAyq/qe5lHkMF6yoVvRUTofJCs0 X-Received: by 2002:a17:907:d504:b0:7ad:b6d6:9188 with SMTP id wb4-20020a170907d50400b007adb6d69188mr147322ejc.418.1668129607817; Thu, 10 Nov 2022 17:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668129607; cv=none; d=google.com; s=arc-20160816; b=JbCewS4M8mm30FRpkp6JGeva9RQev8BRAtnT9jigehlIHlTDuDT3E8ZREoPwcofHU/ /ZLVAR9oPjfCTT8ODaUU16fxLqLYx7/hnikhspnw0RL/985MbI7M70blXlvEFo90I9Q4 7ikHA1a1QLkrtGO/yTol9g6okGywpf7oNqqHyCaYuuOn6HMr9TN+10LxHosyG5ujYX02 1h0FXxXbk0TlEiV07hIXKzjR4/f9k/G90oHjhN7vNHgZbTJ5gl/Z/5Q9N9gHTIQmuBGW cJvCq6ypUHmxmOda+amoRriKu6KBdlMG2PqcefTGFJHHAGr04cW1zkBb3QRYDV19EhsV J8rg== 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=SmKIOoZfbc6W1sDKcr+0350zzLyXn/3XNLk3UbqDz7M=; b=E+MueriMXk5FOA4js4UY6SQA9aLwha14MCXUtNekPYUSU27r7lHTZ2rnBsk7tg1oXC x+sIfQk0qboW12oMXqNBmIiVfhgshbT8zy4BSVWnTwzXq2PSwh/cVoOsxAwxdPN0pyUf OTSOha+LLGfo0V+ib741zr5aeh8De0W/e7Ci4EBOiFpPTn/I76RpQ4Z0v9ODzBG7dxhq yOglF/U0q3S9Kf4734PYyP26HQaaowBmAPBxwymOlPEn+liA3Du6bKLMxB4Ei438n8Ad KKB7laKDBA7aFwMbvnq3x2IyB5BTzjKpaZsDJcoEgc3MClvQ9djYzqdqbeUswiz3TejS Ij+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202211 header.b=I4G4eXq0; 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 v25-20020a50d599000000b0045c9313faf7si935086edi.353.2022.11.10.17.19.44; Thu, 10 Nov 2022 17:20:07 -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=I4G4eXq0; 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 S232365AbiKKBQU (ORCPT + 99 others); Thu, 10 Nov 2022 20:16:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbiKKBPU (ORCPT ); Thu, 10 Nov 2022 20:15:20 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C85964A36; Thu, 10 Nov 2022 17:14:54 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 7CCF92A2; Fri, 11 Nov 2022 02:14:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1668129293; bh=tQs2et+30q6TN810oq+7r53WPOu/UGbheN1qxHEf9KU=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=I4G4eXq0aT/iCuyIVKNrHplLMz/549E20HLmOLJ3dT9OGjo/NnC0dCc+V0OOAsRgr 5qzAJHNV9tAISAHwfN9PbcE4jievI2XGFjoOUisKuLK2vPWJXGQ9P39fwkDkkia5zX fpwjpPRik2GC4gOODkhrhdBgHbU6UCvm3ADc5x5PKL/uyF+wKJZDTKmCL+tyCBLep4 r2O4MztX7H5VsaNwEetiABhqDGOfvgyfot/Ym1h5Zjz5LYFgEmHZlhGQuclz/I6PRk w60NhAUVyKdiOQM9fHXVoqkc/H9QSbjQ0oMT2NOWCiBAZ9vqK4HDgJiY5JjkNFqB+/ LDFQYMvMwji3w== Date: Fri, 11 Nov 2022 02:14:52 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Steven Rostedt , Jani Nikula , Laura Abbott , Wenwen Wang , Thorsten Leemhuis , Kees Cook , Lukas Bulwahn , Greg Kroah-Hartman , Jiri Slaby , Jakub Kicinski , Wu XiangCheng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v3 15/15] Documentation: remove magic-number.rst Message-ID: <93e66d80680c52e8d04763fb2d86f841c69e32c9.1668128257.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749160671779523620?= X-GMAIL-MSGID: =?utf-8?q?1749160671779523620?= All noted magic numbers have been removed, and we don't want to encourage magicking up kernel structs going forward. Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/index.rst | 1 - Documentation/process/magic-number.rst | 71 ----------------- .../translations/it_IT/process/index.rst | 1 - .../it_IT/process/magic-number.rst | 77 ------------------- .../translations/zh_CN/process/index.rst | 1 - .../zh_CN/process/magic-number.rst | 60 --------------- .../translations/zh_TW/process/index.rst | 1 - .../zh_TW/process/magic-number.rst | 63 --------------- 8 files changed, 275 deletions(-) delete mode 100644 Documentation/process/magic-number.rst delete mode 100644 Documentation/translations/it_IT/process/magic-number.rst delete mode 100644 Documentation/translations/zh_CN/process/magic-number.rst delete mode 100644 Documentation/translations/zh_TW/process/magic-number.rst diff --git a/Documentation/process/index.rst b/Documentation/process/index.rst index d4b6217472b0..a8c0c4bffa47 100644 --- a/Documentation/process/index.rst +++ b/Documentation/process/index.rst @@ -59,7 +59,6 @@ lack of a better place. applying-patches adding-syscalls - magic-number volatile-considered-harmful botching-up-ioctls clang-format diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst deleted file mode 100644 index 5a8c2755ac9c..000000000000 --- a/Documentation/process/magic-number.rst +++ /dev/null @@ -1,71 +0,0 @@ -.. _magicnumbers: - -Linux magic numbers -=================== - -This file is a registry of magic numbers which are in use. When you -add a magic number to a structure, you should also add it to this -file, since it is best if the magic numbers used by various structures -are unique. - -It is a **very** good idea to protect kernel data structures with magic -numbers. This allows you to check at run time whether (a) a structure -has been clobbered, or (b) you've passed the wrong structure to a -routine. This last is especially useful --- particularly when you are -passing pointers to structures via a void * pointer. The tty code, -for example, does this frequently to pass driver-specific and line -discipline-specific structures back and forth. - -The way to use magic numbers is to declare them at the beginning of -the structure, like so:: - - struct tty_ldisc { - int magic; - ... - }; - -Please follow this discipline when you are adding future enhancements -to the kernel! It has saved me countless hours of debugging, -especially in the screwy cases where an array has been overrun and -structures following the array have been overwritten. Using this -discipline, these cases get detected quickly and safely. - -Changelog:: - - Theodore Ts'o - 31 Mar 94 - - The magic table is current to Linux 2.1.55. - - Michael Chastain - - 22 Sep 1997 - - Now it should be up to date with Linux 2.1.112. Because - we are in feature freeze time it is very unlikely that - something will change before 2.2.x. The entries are - sorted by number field. - - Krzysztof G. Baranowski - - 29 Jul 1998 - - Updated the magic table to Linux 2.5.45. Right over the feature freeze, - but it is possible that some new magic numbers will sneak into the - kernel before 2.6.x yet. - - Petr Baudis - - 03 Nov 2002 - - Updated the magic table to Linux 2.5.74. - - Fabian Frederick - - 09 Jul 2003 - - -===================== ================ ======================== ========================================== -Magic Name Number Structure File -===================== ================ ======================== ========================================== -===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/index.rst b/Documentation/translations/it_IT/process/index.rst index 8d4e36a07ff4..71adf53bc297 100644 --- a/Documentation/translations/it_IT/process/index.rst +++ b/Documentation/translations/it_IT/process/index.rst @@ -56,7 +56,6 @@ perché non si è trovato un posto migliore. applying-patches adding-syscalls - magic-number volatile-considered-harmful clang-format ../riscv/patch-acceptance diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst deleted file mode 100644 index 2fbc1876534a..000000000000 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ /dev/null @@ -1,77 +0,0 @@ -.. include:: ../disclaimer-ita.rst - -:Original: :ref:`Documentation/process/magic-number.rst ` -:Translator: Federico Vaga - -.. _it_magicnumbers: - -I numeri magici di Linux -======================== - -Questo documento è un registro dei numeri magici in uso. Quando -aggiungete un numero magico ad una struttura, dovreste aggiungerlo anche -a questo documento; la cosa migliore è che tutti i numeri magici usati -dalle varie strutture siano unici. - -È **davvero** un'ottima idea proteggere le strutture dati del kernel con -dei numeri magici. Questo vi permette in fase d'esecuzione di (a) verificare -se una struttura è stata malmenata, o (b) avete passato a una procedura la -struttura errata. Quest'ultimo è molto utile - particolarmente quando si passa -una struttura dati tramite un puntatore void \*. Il codice tty, per esempio, -effettua questa operazione con regolarità passando avanti e indietro le -strutture specifiche per driver e discipline. - -Per utilizzare un numero magico, dovete dichiararlo all'inizio della struttura -dati, come di seguito:: - - struct tty_ldisc { - int magic; - ... - }; - -Per favore, seguite questa direttiva quando aggiungerete migliorie al kernel! -Mi ha risparmiato un numero illimitato di ore di debug, specialmente nei casi -più ostici dove si è andati oltre la dimensione di un vettore e la struttura -dati che lo seguiva in memoria è stata sovrascritta. Seguendo questa -direttiva, questi casi vengono identificati velocemente e in sicurezza. - -Registro dei cambiamenti:: - - Theodore Ts'o - 31 Mar 94 - - La tabella magica è aggiornata a Linux 2.1.55. - - Michael Chastain - - 22 Sep 1997 - - Ora dovrebbe essere aggiornata a Linux 2.1.112. Dato che - siamo in un momento di congelamento delle funzionalità - (*feature freeze*) è improbabile che qualcosa cambi prima - della versione 2.2.x. Le righe sono ordinate secondo il - campo numero. - - Krzysztof G. Baranowski - - 29 Jul 1998 - - Aggiornamento della tabella a Linux 2.5.45. Giusti nel congelamento - delle funzionalità ma è comunque possibile che qualche nuovo - numero magico s'intrufoli prima del kernel 2.6.x. - - Petr Baudis - - 03 Nov 2002 - - Aggiornamento della tabella magica a Linux 2.5.74. - - Fabian Frederick - - 09 Jul 2003 - - -===================== ================ ======================== ========================================== -Nome magico Numero Struttura File -===================== ================ ======================== ========================================== -===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/index.rst b/Documentation/translations/zh_CN/process/index.rst index a1a35f88f4ae..300d579b3ad0 100644 --- a/Documentation/translations/zh_CN/process/index.rst +++ b/Documentation/translations/zh_CN/process/index.rst @@ -52,7 +52,6 @@ .. toctree:: :maxdepth: 1 - magic-number volatile-considered-harmful .. only:: subproject and html diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst deleted file mode 100644 index f8ec4767bc4e..000000000000 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ /dev/null @@ -1,60 +0,0 @@ -.. _cn_magicnumbers: - -.. include:: ../disclaimer-zh_CN.rst - -:Original: :ref:`Documentation/process/magic-number.rst ` - -如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可 -以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者:: - - 中文版维护者: 贾威威 Jia Wei Wei - 中文版翻译者: 贾威威 Jia Wei Wei - 中文版校译者: 贾威威 Jia Wei Wei - -Linux 魔术数 -============ - -这个文件是有关当前使用的魔术值注册表。当你给一个结构添加了一个魔术值,你也应该把这个魔术值添加到这个文件,因为我们最好把用于各种结构的魔术值统一起来。 - -使用魔术值来保护内核数据结构是一个非常好的主意。这就允许你在运行期检查(a)一个结构是否已经被攻击,或者(b)你已经给一个例行程序通过了一个错误的结构。后一种情况特别地有用---特别是当你通过一个空指针指向结构体的时候。tty源码,例如,经常通过特定驱动使用这种方法并且反复地排列特定方面的结构。 - -使用魔术值的方法是在结构的开始处声明的,如下:: - - struct tty_ldisc { - int magic; - ... - }; - -当你以后给内核添加增强功能的时候,请遵守这条规则!这样就会节省数不清的调试时间,特别是一些古怪的情况,例如,数组超出范围并且重新写了超出部分。遵守这个规则,‪这些情况可以被快速地,安全地避免。 - - Theodore Ts'o - 31 Mar 94 - -给当前的Linux 2.1.55添加魔术表。 - - Michael Chastain - - 22 Sep 1997 - -现在应该最新的Linux 2.1.112.因为在特性冻结期间,不能在2.2.x前改变任何东西。这些条目被数域所排序。 - - Krzysztof G.Baranowski - - 29 Jul 1998 - -更新魔术表到Linux 2.5.45。刚好越过特性冻结,但是有可能还会有一些新的魔术值在2.6.x之前融入到内核中。 - - Petr Baudis - - 03 Nov 2002 - -更新魔术表到Linux 2.5.74。 - - Fabian Frederick - - 09 Jul 2003 - -===================== ================ ======================== ========================================== -魔术数名 数字 结构 文件 -===================== ================ ======================== ========================================== -===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/index.rst b/Documentation/translations/zh_TW/process/index.rst index c5c59b4fd595..cb3dea0b78ab 100644 --- a/Documentation/translations/zh_TW/process/index.rst +++ b/Documentation/translations/zh_TW/process/index.rst @@ -54,7 +54,6 @@ .. toctree:: :maxdepth: 1 - magic-number volatile-considered-harmful .. only:: subproject and html diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst deleted file mode 100644 index 0ccc60bee3d6..000000000000 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0 - -.. _tw_magicnumbers: - -.. include:: ../disclaimer-zh_TW.rst - -:Original: :ref:`Documentation/process/magic-number.rst ` - -如果想評論或更新本文的內容,請直接發信到LKML。如果你使用英文交流有困難的話,也可 -以向中文版維護者求助。如果本翻譯更新不及時或者翻譯存在問題,請聯繫中文版維護者:: - - 中文版維護者: 賈威威 Jia Wei Wei - 中文版翻譯者: 賈威威 Jia Wei Wei - 中文版校譯者: 賈威威 Jia Wei Wei - 胡皓文 Hu Haowen - -Linux 魔術數 -============ - -這個文件是有關當前使用的魔術值註冊表。當你給一個結構添加了一個魔術值,你也應該把這個魔術值添加到這個文件,因爲我們最好把用於各種結構的魔術值統一起來。 - -使用魔術值來保護內核數據結構是一個非常好的主意。這就允許你在運行期檢查(a)一個結構是否已經被攻擊,或者(b)你已經給一個例行程序通過了一個錯誤的結構。後一種情況特別地有用---特別是當你通過一個空指針指向結構體的時候。tty源碼,例如,經常通過特定驅動使用這種方法並且反覆地排列特定方面的結構。 - -使用魔術值的方法是在結構的開始處聲明的,如下:: - - struct tty_ldisc { - int magic; - ... - }; - -當你以後給內核添加增強功能的時候,請遵守這條規則!這樣就會節省數不清的調試時間,特別是一些古怪的情況,例如,數組超出範圍並且重新寫了超出部分。遵守這個規則,‪這些情況可以被快速地,安全地避免。 - - Theodore Ts'o - 31 Mar 94 - -給當前的Linux 2.1.55添加魔術表。 - - Michael Chastain - - 22 Sep 1997 - -現在應該最新的Linux 2.1.112.因爲在特性凍結期間,不能在2.2.x前改變任何東西。這些條目被數域所排序。 - - Krzysztof G.Baranowski - - 29 Jul 1998 - -更新魔術表到Linux 2.5.45。剛好越過特性凍結,但是有可能還會有一些新的魔術值在2.6.x之前融入到內核中。 - - Petr Baudis - - 03 Nov 2002 - -更新魔術表到Linux 2.5.74。 - - Fabian Frederick - - 09 Jul 2003 - -===================== ================ ======================== ========================================== -魔術數名 數字 結構 文件 -===================== ================ ======================== ========================================== -===================== ================ ======================== ==========================================