From patchwork Tue Nov 1 23:05:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3261501wru; Tue, 1 Nov 2022 16:06:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vJaXLlA/yE/jhB75N+BOJNP4VDqLmZmYgi7UHR033Ni0Zx11FYualLL171rN/5Dc+pWb/ X-Received: by 2002:a63:2061:0:b0:46e:d84b:719f with SMTP id r33-20020a632061000000b0046ed84b719fmr18795253pgm.169.1667343989141; Tue, 01 Nov 2022 16:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667343989; cv=none; d=google.com; s=arc-20160816; b=g/S3tdVLZli95Gq2WhV/mwzBTsGDZUkjsRzsMXjsQ2NQdetURwBMfqfG31ae9UD/ul LNqArCCLCpdLYbICWxJI0nQ3Gx6OzWpf4Pen7DGnIZjkmcB6x2Kf55trYOinqJdJS/hY yyikxu0G04MA3T6K3dKGY0Ne9ukhRkuRNVSFJh3tr9xbtOUhsr4H0pX18HsxRwwMzNSK qe9plCl1JrOVzwLT2AkEYS4vysyUOwJ3kuLxQCO5gmh5wF9VuJyfxeE4jIrO83ClHv/M OyvsL88B3v0ybqUATX//9C7fFSMMAYTkSoL6Ycuy2k9CpUNvEju+KY8RQefgilJTgZyf oLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=6HjqFzUBjTMeRbXDBLO3/LKIZZCfMDcneS4q9VatxFc=; b=PRuq3mUdstn7eIvFnpzl18s1OV89+hZV2ZoP1bdJNMzFHNsFpq/HcDZVexoTapHDBg 9pKzcvzk6UvRBmfrUiCuV6FgBvyTDylhEqjvl5FaCJTG9yWrb0R01yEzQHh7favJN9ST jfNokQjXT4HYbdILGNaEcp01FekfI+fbKQMOPgRWoYfI46cBHZw0u3ogcrnaS6m44JNp dBNxWpfzcft5P1BfB1alKfiJCMM00fth/Ncw+XTqpo8GEzinCj2f+wa3JWCClUnBkSWF ZXGbAETxGVrq3vm8uplU+mvP9OWL7x3qQaXmrAOm2v1UUnfE5lhrjT0Pqlx69cSm9AdB qldQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=M+LDVQoZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a63ea4f000000b0046f729604fesi4136002pgk.170.2022.11.01.16.06.16; Tue, 01 Nov 2022 16:06:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=M+LDVQoZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbiKAXF3 (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbiKAXFW (ORCPT ); Tue, 1 Nov 2022 19:05:22 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E26DF01A; Tue, 1 Nov 2022 16:05:02 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id C936D4ED6; Wed, 2 Nov 2022 00:05:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343901; bh=sqF6M40mTe+GMCjQFaEsJ1ZjHEHltPKbbHcjSmMmLiQ=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=M+LDVQoZbugRpd3IJ7349nnHdg1XnBeovSVBRsUGuJKds/1CCK56zXFaPbBluGHPc 8OPrWZC0r4y7tkIsZXa7BTGiaGEsLNo1Mn0itPa5PtLPnPn3U6Un/P270AGXwDoHlz MW1ivjN27FAeeM+fUXPwtwkPysSnZVbUnf2AHdoYsp7E6WltF70SxZeGg/ZU8ikiAn BSXDPbRwrWkFDGuYN9Bm0Dy7xZh2T8aOfxqG2244o7O4XgR/pPDkViocfDi3Hm5vvh iHTRjOYqX3MG315jfifJaku+UrJGNChtIRCCy949L+rpVeCX7nY7zic82qbhWAFYYc n8T0yKlhHA/Lf+b9wjPW1sm59p0RElFeLnpPQXDIgN1CCEFEMuU9IdaDRqS0usQ8Ol 00mVM4kJxoD0PorJvEaV61VLW8OjSFPm/dyG5CvB2R3Eq7F/+NK4pPlkrGcazxaIuA WsfRgZgOZKs0oqa5XckglMb3nxUijj2N4SNSJ5Te9u7Hchg5y7XOYz0aufwHIBTg47 0pnVZqIRN+z+gKJ19xJWyv5QbvmjYYYRU600F1t5WnqHB3oLYAYaEdtncQQAc2SHcr ZDP1WW0wRgx4UpjaABuJKXkr9YDenmFdrXd8NzwSi0LsdawXZ8qc6YdSBno7ciGBxK 5LFevY0MwNnnriJBzwg3OTbQ= Date: Wed, 2 Nov 2022 00:05:00 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Thomas Sailer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-hams@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 01/15] hamradio: baycom: remove BAYCOM_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336890490893997?= X-GMAIL-MSGID: =?utf-8?q?1748336890490893997?= Before being defanged in v2.6.12-rc1, the magic was validated on each netdev_priv() invocation; after, it's set exactly once per port on probe and checked exactly once per port on unload: it's useless. Kill it. Notably, magic-number.rst has never had the right value for it with the new-in-Linux-2.1.105 network-based driver, rendering this documentation worse than useless. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 1 - .../translations/it_IT/process/magic-number.rst | 1 - .../translations/zh_CN/process/magic-number.rst | 1 - .../translations/zh_TW/process/magic-number.rst | 1 - drivers/net/hamradio/baycom_epp.c | 15 ++------------- 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 64b5948fc1d4..87353e0207c1 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -73,7 +73,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 02eb7eb2448e..a96712bd8a68 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -79,7 +79,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 0617ce125e12..44f3a29fce57 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -62,7 +62,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index f3f7082e17c6..0fde3183e82a 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -65,7 +65,6 @@ APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kerne FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` -BAYCOM_MAGIC 0x19730510 baycom_state ``drivers/net/baycom_epp.c`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 791b4a53d69f..8f018703e74d 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -45,13 +45,9 @@ /* --------------------------------------------------------------------- */ #define BAYCOM_DEBUG -#define BAYCOM_MAGIC 19730510 /* --------------------------------------------------------------------- */ -static const char paranoia_str[] = KERN_ERR - "baycom_epp: bad magic number for hdlcdrv_state struct in routine %s\n"; - static const char bc_drvname[] = "baycom_epp"; static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" "baycom_epp: version 0.7\n"; @@ -152,8 +148,6 @@ static struct net_device *baycom_device[NR_PORTS]; */ struct baycom_state { - int magic; - struct pardevice *pdev; struct net_device *dev; unsigned int work_running; @@ -1210,7 +1204,6 @@ static void __init baycom_epp_dev_setup(struct net_device *dev) * initialize part of the baycom_state struct */ bc->dev = dev; - bc->magic = BAYCOM_MAGIC; bc->cfg.fclk = 19666600; bc->cfg.bps = 9600; /* @@ -1279,12 +1272,8 @@ static void __exit cleanup_baycomepp(void) struct net_device *dev = baycom_device[i]; if (dev) { - struct baycom_state *bc = netdev_priv(dev); - if (bc->magic == BAYCOM_MAGIC) { - unregister_netdev(dev); - free_netdev(dev); - } else - printk(paranoia_str, "cleanup_module"); + unregister_netdev(dev); + free_netdev(dev); } } parport_unregister_driver(&baycom_epp_par_driver); From patchwork Tue Nov 1 23:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262418wru; Tue, 1 Nov 2022 16:08:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51q9IwRM4VbaAp6ANb3xzD3IPfADP4DwNfg12nB0ZH53fYuc/E2QE+80aQvg+QpXKGlCJI X-Received: by 2002:a05:6402:2802:b0:43a:9098:55a0 with SMTP id h2-20020a056402280200b0043a909855a0mr21138357ede.179.1667344081889; Tue, 01 Nov 2022 16:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344081; cv=none; d=google.com; s=arc-20160816; b=vIAWvetF3J7C3VrT7WbOEu1hIvYE8i9/p3u0oEA20dw37ET+kVLmRqMD/FNqZHcyM4 86JX//MVUzFyyKAYpEoEleAi7VfV7XRhZ0cwsyjEWjWnqXl5cMroWebF09+xTK1E4Kt0 5dGr2noYQcKmW3F62u4urw2Ut6Bb9JqWMEEIkjzeBUGaHoxIvxsXp4171DgmN0HU/XO7 2xvxgM+UBj2WJR1qLmk3RGN5fpwqZfqzg4b5vRFPNMbfPhQzRPx0297Ah1mDOItyACSJ 07Z65rojbqya0FV+sbq5UlyKi5tJ3AyAJErRmcD267ai31j0OTwsaWQ/BC2Kpbt5qivo oH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=O8SLUSC++D/VFXD+nylZOq9AMKnj7N9xaR3xnStVMtU=; b=ol3PVOXWb6/kbdhCPY2DoOlFycM0ImUHtQIx0nH/K/8U9vkUkqgogaTGW7VSGT+acU r4/P3k3GubRbGbwYRGLEwskgQSBC3r+EV4f7irDJaQnHbu5olFzfUPpxVlotFtgNNNDh 7gggx7t3KOJym13EIA/HUp2JIvMoI89kYz8QNtEyrPbcDgsEQ7JbE/2q2o1bo1wpjqkP HOM0YdzuYhG7hZ5iHqDBiuv+1EbfJ35Rnmd1rV4kueLF3gx9GFYf8bymlemMU6eNza+/ HAZmyeJGkCJ/iOeD1FDKGJJIVLZp57XJIAzvsVE6T5NCIskpt1upXLg1jNlWZz/8hPVR FYVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="ik/mbhUb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh20-20020a1709076e9400b00780e89aecd1si13783454ejc.849.2022.11.01.16.07.37; Tue, 01 Nov 2022 16:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="ik/mbhUb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbiKAXFe (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiKAXFZ (ORCPT ); Tue, 1 Nov 2022 19:05:25 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48C6B2035C; Tue, 1 Nov 2022 16:05:10 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 886E04EDA; Wed, 2 Nov 2022 00:05:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343909; bh=1C2PA3CPeOAdYlYDjeuzEbLN4NuRAcpssYiDt09L1oo=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=ik/mbhUbQpJG7TCVAGlObFN62AVvNN2lkaAWCb2/g7csdiNi85awwxYFqEmw+JME8 11rqLMfv9CiZ8W4xHSqPPaH2KsFpH46nrV9s0lTIXZbJ6Q8eEjfrJVw/jzNBjvMfnx 5xHlEFx/tg6V0haiTl2HiG2gPHbAD2vnFYiyVSpGYzB2iWzAaelhDRACWGNayU1qzq Px9N9SoZKKmgoE0n1I7ySClfoQvxU/K8NbbJCkqIZUhU+ZV+JNWtw5XJ/FppyS68eg e5Otg7sfOw0RVGpVnZ01KAadIW2S/OnBSpO3RvslyzMYe/MQi6mh4obQQxAHcOOzKs Xl9B8B5p+VrYI7JdDZtJPtbgZfgnD7kNjsBWmmwTTeGNmXD166Bhmz92GLeJ3WQvKt UYssTFHFnROrwwqEqGTEQAouTP7TYNjhXHW7wARCd8r18abDA63TeroPY1K4e/JiNO pKDcnJ8A+aDx4YXlRy160HKC8iqOhn8VfXeOvi9yxtYdo2GXcTrh2txrMamMRbEc6b gDSyG/pVO+C0vZnSF25Z1Nq6Es9UTm+WlcCE8/9Jg/WprCmk5DEC+MZQeP29GtMeAP fNUfWOksyCgqU9QGpjuYukr3ZBIB1zdPezdRP0X+8a3UAVo7hJ/LxUKA/6OfkbORko T7I8wKdO5MFx+DV91Qb/uUWo= Date: Wed, 2 Nov 2022 00:05:08 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jean-Paul Roubelat , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-hams@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 02/15] hamradio: yam: remove YAM_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336987620305180?= X-GMAIL-MSGID: =?utf-8?q?1748336987620305180?= This is checked inconsistently, only in contexts following directly from the module init, and returns an error to userspace/ignores the condition entirely, rather than yielding remotely-useful diagnostics. This is cruft, and we have better debugging tooling nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 1 - Documentation/translations/it_IT/process/magic-number.rst | 1 - Documentation/translations/zh_CN/process/magic-number.rst | 1 - Documentation/translations/zh_TW/process/magic-number.rst | 1 - drivers/net/hamradio/yam.c | 8 +------- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 87353e0207c1..a4414b7e15aa 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -76,7 +76,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index a96712bd8a68..f51c5ef9d93f 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -82,7 +82,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 44f3a29fce57..3b53bd67e41b 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -65,7 +65,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 0fde3183e82a..7d176a87ec3c 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -68,7 +68,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 2ed2f836f09a..0f43411a6ca5 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -73,7 +73,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define YAM_1200 2 #define NR_PORTS 4 -#define YAM_MAGIC 0xF10A7654 /* Transmitter states */ @@ -94,7 +93,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define DEFAULT_PERS 64 /* 0->255 */ struct yam_port { - int magic; int bitrate; int baudrate; int iobase; @@ -604,7 +602,7 @@ static void yam_arbitrate(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - if (yp->magic != YAM_MAGIC || yp->tx_state != TX_OFF || + if (yp->tx_state != TX_OFF || skb_queue_empty(&yp->send_queue)) return; /* tx_state is TX_OFF and there is data to send */ @@ -930,9 +928,6 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __ if (copy_from_user(&ioctl_cmd, data, sizeof(int))) return -EFAULT; - if (yp->magic != YAM_MAGIC) - return -EINVAL; - if (!capable(CAP_NET_ADMIN)) return -EPERM; @@ -1079,7 +1074,6 @@ static void yam_setup(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - yp->magic = YAM_MAGIC; yp->bitrate = DEFAULT_BITRATE; yp->baudrate = DEFAULT_BITRATE * 2; yp->iobase = 0; From patchwork Tue Nov 1 23:05: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: 13952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3261724wru; Tue, 1 Nov 2022 16:06:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LwCoayTEVwXUwia2/tTd0zNJOl9Y+gx30PUX7XaHMJpV8Baswz/kLOPCAU8xFtVST08/o X-Received: by 2002:a17:907:a047:b0:7ac:ff72:977c with SMTP id gz7-20020a170907a04700b007acff72977cmr21107608ejc.260.1667344010861; Tue, 01 Nov 2022 16:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344010; cv=none; d=google.com; s=arc-20160816; b=OHSH3KXUGD1HqYobokHtgNwKEekFw0PAeV4QcbHpNmzySV2PFrbVFf1r01dh6oVc+a BMoFcI32dgFuD02tzC7Jrvammf7LZX68djCQoSKCPtsgn5CweMpYyW1MjpAFRtRb6M2T rZUYU3bCNGzbS8IxkZ90iKWKTfZO1wExK184KeSsaXGpXKIiqFqytNno1EPdUVDd//5q cui1J8JZDLtFcIT/3dT47TtToa8vDE5CFW/xlUc5hROecUlMFnjoYoZx2LGpqouCD5zK lZWSmdgy262w0981QEStr6HhBNNpXNN58iJyuqrIpxZ/dpfdAL9UVhsUIAVTVrg/Ig23 texg== 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=hZrKZ/kjXvMRijozHmIh2zo9SWAXCrPW9qpMOvtkSNY=; b=DY/CSod/wC1CR/JVvSFuOsuGjrJPHxCW1Txlk92c8KtvIxEqdKspzJrDAj5EH4BJZt E8trPruOzfFXYmuJBmAc+C1vePByNLGGRWonpyB2j/F8l/DPKliEDvzoi9XRWlZNLdhI uVremEvHWoFBS+cUlcT12RdXCk9kImkAbsxs+Kw3E2M/OaGyhQG2RvDSCrD3rnAt3GoR xftYGpZKRIhOkvPVepLuD8SPAB0iHF2FpOQJVzdSOSWux6n9sJOO8FkrkqrEpdOxWW9Z 5+VUnRYLOYd3+QFYDuTt3B+iNgtDGah5FjfnFaG3W+1BZYaKN2PGnhWu/Kf6q034NAGD 8VAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=BOtOuXSa; 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 b11-20020a056402084b00b00463ab1bf95bsi5477583edz.94.2022.11.01.16.06.26; Tue, 01 Nov 2022 16:06:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=BOtOuXSa; 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 S231232AbiKAXFh (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiKAXFZ (ORCPT ); Tue, 1 Nov 2022 19:05:25 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA6AD201B6; Tue, 1 Nov 2022 16:05:14 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 364744EDC; Wed, 2 Nov 2022 00:05:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343914; bh=+UKsAgRkYwH0P7LvkS7eTSehZSfe3qZMT/OrdLiAgRQ=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=BOtOuXSaZ5DQvmBE5tVcDRKYynMHpX4YonAA4WKIe5cJWUZV91jAkUS8M3wgMhwem hbZ2+HIv/WZrpW/LxznzOWtDeeR/i3VaU4voW0FHWaTTkkAwql3Bo7Nrat2CXx0xw7 oip5KYOSVMZO4ZOa9LScUP0oLvsprica7wx221C8bIxLd3rLChWbh8QeSQeTgGr2Rp QmFvYutz4sjvGa7k2MBuY/SKArkn+PiMwNjUgMbMQihQ+Q/k+HKVZIr+FQb4FU/sQm nlqFQZYiK+7yRxSfJwppVA1U7I3az/07LiRbm4GFhwQcY8uAfkTc3k2lvBSkUfhXQ2 8pJ8qr7MH1VGa5cOLp4ZUwIjCIF8SsRYGO9QYVNXuIQTfDcPL6BzOuI6epIpuE1haw 9UgqHuJf0ypYO3FEvxZ7t51fnZUuPwicIXJzycf1pBmJaOddwqWPI3OnLpM6WSk65e qGywaT3VBCxqdcyhsf7qJCDRkiq9OONteJwWiLPQ9His4TjwWSzMXe3z2aA3xyVq6d SAXHyyJmqCqD9tuE2o/Cnx9SIzxNcn+0HvNgl4wTr/5jTetWbEOYILN1B5Kngese2l ALLWcRit1+Ps7BMJSYvyf2AD9CxphKbXJd2KhVazOG7reTk8ZDbh1WFSRvH10cnTdJ MgCq+qmiL/MGb2/2PDomCRmE= Date: Wed, 2 Nov 2022 00:05:13 +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 , Jiri Slaby , Ilpo =?utf-8?b?SsOkcnZpbmVu?= , Haowen Bai , Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v2 03/15] pcmcia: synclink_cs: remove MGSLPC_MAGIC Message-ID: <97d4e73a458993348cf46711c63cbbb53b65ebdd.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336913683448526?= X-GMAIL-MSGID: =?utf-8?q?1748336913683448526?= 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 Tue Nov 1 23:05:21 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: 13953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3261994wru; Tue, 1 Nov 2022 16:07:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Vz/fJUebSO6W6PP0REZKPkNZ+i/jbXMiN1wVWVLdLWI1kIwz7WvmAJaFmrL+Vnau4mB2L X-Received: by 2002:aa7:ce09:0:b0:461:5406:20e4 with SMTP id d9-20020aa7ce09000000b00461540620e4mr21791361edv.5.1667344039251; Tue, 01 Nov 2022 16:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344039; cv=none; d=google.com; s=arc-20160816; b=VPaCvd8xgawuzb+nZWh2DB85elVB43yLNfKiHrIOb6JO/psEiBBpRI+etUXfsvBVSg K+PgPysLkW4GpDHDWC/4icWgRH1DdtuqCjemizZV2ToLX1bHJiFeTRvjpvLmvLP5eGpe 7nzUMUQF94U1x8pyQ/lfWa4qoAR2bBQbE2sRmfhp7MkxP083FFBukpIxaObd10fmM/9A xNDtjh/Doy+GyZRGCBZQpKtPLnNL5z0AVWKQ6T1nWLeZknXcYyhFPszjK60Mgk+f7P3x ilN/1tatASZ5Edelvy0bdfXGGoQ9YsNYdycoAD63hincMJPX3xaFmJe2EvcPZNv5kHGN ZcaQ== 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=00gsAulilkCCCrCyeYuHtbm4aj0uvOZOePyNFAywqJc=; b=IHEDXL9xKUhHpCsBXd2tmSUffszJgWGMUEUBLfuBypIbtlLr8xoCS22IF10lMbj0DI dZx7A+/taf5en6W3dPVEW6EmfJevrywUmwNVX8qi0EuPkJZUrqU/JHEybQ0jQCq6m8qy KaoAHdueyma5J6aeOfRip374B39Hmn4T7dP/CXbcssnN/giXgh0MMNOrWEH+h+6EHTzL gSRSik6mHiYwyl0T0ZdgZxgRFvEbTvpGakvI2azsqpmH5pSmNcTMqJPX21BiOgtla5T4 vLGk8qqJHnHfIxTn0XG+o5/gw22v9uRhOeYhtkO2+6Qo0Jg9YWWT6OfXspSFjJyMCY5c m9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="DOZ/iY9V"; 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 d6-20020a056402400600b0046125ddf5easi12327892eda.185.2022.11.01.16.06.32; Tue, 01 Nov 2022 16:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="DOZ/iY9V"; 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 S230437AbiKAXFo (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbiKAXF0 (ORCPT ); Tue, 1 Nov 2022 19:05:26 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D014060FB; Tue, 1 Nov 2022 16:05:23 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 058F84EE4; Wed, 2 Nov 2022 00:05:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343923; bh=5guxHxeMZO6jIhjwoXxtFNICxaf3NerLu1RM6JzApG4=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=DOZ/iY9VEwQrhOuresZhwUToPAjrGxbNLWtvATGCJF/4go+9j/vqg7qzRFZUwgxL0 oIyqPGCrnf7bTW/g6D00WKuA9nrlq6qe6Og1tWtZveGnphXUU6eqBZt8zLRU87czrB uYY39qwZdFHmrbm6BdWtd4ohAmGB72vJCXecnyEHnlvh7ZAtGUZHI6KfiwMu1VE3sI D7cQmliNCrOj/cg7/6xCoY9e0KOiwcJGyIqkh6wzmH611pN0nTSsyPq62rW2O6uCAS CoKSmGvLxb+OHZA46BbFiiopFl0fxLjOHTjc+BKwRdOfuMIL+hDO25MB71f1OSuruL J84ebKfovFSpHjj87gYE/ggggv4OnXO93FU7kYjUD1f+BpskCcoqowDdClF8TD3bUN F7Lus6J1DqIfdyHZdJt5CiLzD/Hjex3fWt5HHaVd7Cr3PtnefUbC/Vr2MFzOetJrjy 6t2IJ6zjK8wAnVwHCrVP+SLlF6x5CNLSADto4wvKi152wcg/9KxO3Qy9kSkQjBjZ0O rbp7qXzntnmtVxhRDZFp5qQIcK61+G2DwZVTxrMvSH0Qi2s/0v0WSJia8oc/qGc9ud VdiWibn8aQjkq16g3CsZy0QQ/hk2aiyCx6DU6Lzv+qiJIEsaiN0CSrX/lfUGjeB5Kd py8AaTSFkrnZi53mymxcbUuY= Date: Wed, 2 Nov 2022 00:05:21 +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 , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, codalist@coda.cs.cmu.edu Subject: [PATCH v2 05/15] coda: remove CODA_MAGIC Message-ID: <9b1b965d7301e67654d726db42876232333a459a.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336943237213987?= X-GMAIL-MSGID: =?utf-8?q?1748336943237213987?= 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 Tue Nov 1 23:05:26 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: 13957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262157wru; Tue, 1 Nov 2022 16:07:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aUX0sEh+2kRVdQFuhg+P/ycLBtlSAPyaPR0MAP61eBMZpdhK6mwQe3gWfZ7vO4xqFoZm9 X-Received: by 2002:a17:906:8a6f:b0:780:96b4:d19e with SMTP id hy15-20020a1709068a6f00b0078096b4d19emr20428886ejc.624.1667344055412; Tue, 01 Nov 2022 16:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344055; cv=none; d=google.com; s=arc-20160816; b=l2UkG/c18sVN3dBzAdyZiKZPFIKpI4VAa0OmBMJQsQMzBA/YVfTu9mHNajf1Ph9QmE gbCydWYN32HCUylsHsLxTPaXRrpqEEbeCJCWoeyESICCnWe8hQCr5g+RC/rsqVUoKmgC 7v7yisYN/zAU7ika1Qcu6iRML27/MW0XxLdc4SnbaeCTJjLzYIkxfNZgwpW5D6f73Xrp 8ZMFgfg9sWL9HwQQY6d4LdAaRjOdUBLR888E3frfol5YbgOv0UA0146w96cX+zL6lWcM k+uNCmkaVwkgdDJy/nJr5UZ58L1QPDEj4b/Lpfk4Rwnk1z/hbdbHwVcAGLYa8opEi1LW UjQg== 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=f/k4q9mv2oFZNECpzTKcI2j8OOa3uHatNoLloPx5uOw=; b=syH274GQA9B9OJJlg3p9fxJrJ9/KPQ6gPiLzrk5Lr/efoQJEWe+P+p1439rKUFC0v/ 5ksvmt505DGECaGQkS5vE9lapE2BVUTSC8e9Ir76N46EMrUYwfpQDq+p/+LKeBVF8p0i sEmuu6KKLHZF0PMW1fb3nG7egvmt+BF9Zw8wD2+F06HdHmsctMCcJRs5lALKUDDTwYJz 0p3NPJ7t/ygfE40rozMksOlzOphlRel7o6AZqePD46rnMFQQOrFF9dLYJAJ9VqeQmI+f idrGWdUW7MEPGPOLt1IrUKA63qR4gaXixnckjsaDRQse/ITYDw/SeYWMiHU66/c/X/+N xZ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=B0p58ZWX; 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 gs38-20020a1709072d2600b00773dd14c80asi13955903ejc.860.2022.11.01.16.06.49; Tue, 01 Nov 2022 16:07:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=B0p58ZWX; 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 S231403AbiKAXFw (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiKAXFa (ORCPT ); Tue, 1 Nov 2022 19:05:30 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1A15B15A03; Tue, 1 Nov 2022 16:05:28 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 658114EE8; Wed, 2 Nov 2022 00:05:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343927; bh=zESLjyjBHEW9jZv3fgeozBfRJTOunMkXYmtND+hg84U=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=B0p58ZWXPMoiWQ9GS4JAf/1rlpyE7YhSOuZ1naevsb4nMnF74y74RL9BPxwaQZGMG wMEJIS6dyLNQSI5lComDw5qEIaVqqL66K1vdHytkP507fNcYXKUeAeUGd8kJEmhM5i T3sh1J3+F7mFoJrzx/fTozNIXJlbmNOMmxho0C6KdPbiZAIO9aswv7+iruQiF0DS5u kqKcz5FxldwSdmIUpbUrk9sm8cNxy9Zdp6zOuzpPvzMNwVwWTES67q2/BXQbXANeoL 1kOvjwTt/0ejzuyhyUbbtQ5BmmjOhjb96kSAhk14F9/reJYKrf90MCSb1B22XbE2GG JV2qBX9A7DNVMKHvf35Fh4pLmk3PA0a2Z0Fjk2oNnipF5HvvNNwSkldyHk2DSPpCk7 Z5TtMfG/ach+cz0TEGoHIsTtuCpOvVoogIqxOlEFnSrpU4dZP7nWR6QeoFrvs+UYRh 9kHVVdXbQyzN6VuDGk+VM07e5I1gfSfwQru9gTMZhlPxeKV6nFjPr9BG4cjcfEmv5m SaHz5UmJKaNSyP1dxnDTooApRbb67cXe9X/j2W/lzwuXuMkHPRJ+z7rlh2+2MbXBre eZiMHb0mstiWGIlPRU8CX22EU960/pu/b9JTQfxlvxdRnzy6hOa3xvNnGZTGjCYS3c VfMsxphzphDOTMzekCH81ovg= Date: Wed, 2 Nov 2022 00:05:26 +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 , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v2 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=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336960219386724?= X-GMAIL-MSGID: =?utf-8?q?1748336960219386724?= 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 Tue Nov 1 23:05:30 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: 13954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262065wru; Tue, 1 Nov 2022 16:07:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+Y32WDbXsxHAp3CzHFCFGfxkEtSTyXtoKVQylrtV4ouF5zzqjMvizIVFzSbrTvWqkaQT+ X-Received: by 2002:a63:d551:0:b0:452:87e0:73d5 with SMTP id v17-20020a63d551000000b0045287e073d5mr18532359pgi.488.1667344046908; Tue, 01 Nov 2022 16:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344046; cv=none; d=google.com; s=arc-20160816; b=qq6aZigPbDP8FkXe81MyhSEk4XaUYQr3h92tq68qC7kHzp3ooj4sOHFrpe4LW/dS+f C46PemTpSavbHx2g7EYNsKnth+45NOKq/5/rS7AUvJEVjpAWO9ertNyY/EalmYgEpZa8 E1PlHSxGAm+17AydiV3wWe+YXMg3R9LYUInZidmJHW9Ss23fsS9OyaEFW4Jxj6CTH5hW 9o5MVWxONNPBj/h9n938RoSsxKNUWo8/Q9vFHAQSU5WlGqfxBfwyl7W6LaKV0E5/R+vY SGa5+8CysBg/vpJeuC8EKcRf1WjJhJUrlrqwKOpvsWmvpLr594zpYQJO3UcqicPWpMBG WxmA== 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=XmKt63d1twQUK1j6lLsvUd6gb8TRx2FshUvLYaL4lhs=; b=cG/Fvv1gKxdo0SgEgqSuU5tG+RploJuVrQpSjca5GRZLyndzpAkiMHM1gtHd+MFuRK zj8eGf0kLeX3q4oFnxJp0l9Npv5/Eu4ETCyr8Ic/vBZyyl3l8nrBuXgHAz/eH5lmaekL Hz13RclPE47iHvLeO2BGYNkZBHZEAtwYQoDNg/U/MFOOeaH4t5Z37NZ7lHLKbMXf5Mi/ M31TNwoQZyFJRtCJW156ZYP7oPO4HqhCKwAbJ8863+5gm1FU8wKDT2/+y+1sj/5u583b 5Obk6QOwgH2+s0KpsYrfryP1z8WeRbcBAOF+kNiijKpcHU2i4daOh3fQkx+h/y7NvINF Y8QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=b3f5rcxd; 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 t12-20020a63dd0c000000b0046fb6e0b960si8126802pgg.210.2022.11.01.16.07.00; Tue, 01 Nov 2022 16:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=b3f5rcxd; 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 S231424AbiKAXF4 (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231302AbiKAXFd (ORCPT ); Tue, 1 Nov 2022 19:05:33 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7CC76272; Tue, 1 Nov 2022 16:05:32 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 158FF4EEC; Wed, 2 Nov 2022 00:05:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343932; bh=onPrRQdppdHaN8PzCdalvAsxdBD2D0jz8MicPGoWdmg=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=b3f5rcxdg4kwk2OpjLmmaULacqRKIiOV+GgAzhWHDBgeP8fZAfFvHOPLVY0o3hKm4 1kzDthvJizDM7i18SrvXXH2K2OKI0rGYLmr+dip1ZAN6xt5u7JPdKYtrcRDoTJBE6I qrBLM56gLlrsSpPq3b6u102ILInzxjn4T7PxLoGwGq9Z5GBkYr/tueochFiBPJ5Qt9 +CN1IkRl2pQqS6L65dR4xGPNiIPuaolZH+lU7HZoaDJygZ0KrB8K2SkDa6gDRtlkv/ yS18wibSQA/ukpkgrCjm+k83uElbZ7a9J4UYCP373njzX3G2uoNIX1zBgz9bnMW4RO P76rXCprUZzp7seAoqR7XzegmTK+NR1OL1apOdck/G+Ujqp/8A0es9I6iQyEGgPv5x bSRfNFitwjjZTXrSeRBDOV0jqk8n75XLVGYQmJ/m85prleq+tDVGlqkTp4AeVyRPmb GhtEF4fycfBxe9UkmB0tUOHIv/fEWwMREh6ziBV+GEJygAeg3QgLwI3vSlJTRQFw2f FW9unM6wVUcLH1Qw3NLDlQY1mrwIFvpKVPI67zqIspebfIylBjlT+xxh/rUHqT6iiN QqpW359gPHsS6zt2oVAme+KQIc77JbJfoFXgf9CO95mpr3Xx1R5uu+GdJSXDisdBJS szhVq3s734GqqkkzyKxI6p1U= Date: Wed, 2 Nov 2022 00:05:30 +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 , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-mips@vger.kernel.org Subject: [PATCH v2 07/15] MIPS: IP27: clean out sn/nmi.h Message-ID: <534e0e7e4f2b0cc1cb35d5024192473635ed1b94.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336951441404027?= X-GMAIL-MSGID: =?utf-8?q?1748336951441404027?= The only user is arch/mips/sgi-ip27/ip27-nmi.c; this file was imported wholesale in 2.3.99pre9-1, and received only whitespace updates since then. NMI_MAGIC isn't a magic number; it's unclear if it's actually used by the firmware in some capacity or if it's a holdover from copying the SGI code, but in the former case it's API and in the latter it's dead cruft. Lack of QEMU support makes this unvalidatable without the hardware, so leave it in. 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 - arch/mips/include/asm/sn/nmi.h | 60 ------------------- 5 files changed, 64 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`` ===================== ================ ======================== ========================================== diff --git a/arch/mips/include/asm/sn/nmi.h b/arch/mips/include/asm/sn/nmi.h index 12ac210f12a1..0bd9458fc804 100644 --- a/arch/mips/include/asm/sn/nmi.h +++ b/arch/mips/include/asm/sn/nmi.h @@ -10,8 +10,6 @@ #ifndef __ASM_SN_NMI_H #define __ASM_SN_NMI_H -#include - /* * The launch data structure resides at a fixed place in each node's memory * and is used to communicate between the master processor and the slave @@ -29,14 +27,6 @@ */ #define NMI_MAGIC 0x48414d4d455201 -#define NMI_SIZEOF 0x40 - -#define NMI_OFF_MAGIC 0x00 /* Struct offsets for assembly */ -#define NMI_OFF_FLAGS 0x08 -#define NMI_OFF_CALL 0x10 -#define NMI_OFF_CALLC 0x18 -#define NMI_OFF_CALLPARM 0x20 -#define NMI_OFF_GMASTER 0x28 /* * The NMI routine is called only if the complement address is @@ -48,8 +38,6 @@ * */ -#ifndef __ASSEMBLY__ - typedef struct nmi_s { volatile unsigned long magic; /* Magic number */ volatile unsigned long flags; /* Combination of flags above */ @@ -59,14 +47,10 @@ typedef struct nmi_s { volatile unsigned long gmaster; /* Flag true only on global master*/ } nmi_t; -#endif /* !__ASSEMBLY__ */ - /* Following definitions are needed both in the prom & the kernel * to identify the format of the nmi cpu register save area in the * low memory on each node. */ -#ifndef __ASSEMBLY__ - struct reg_struct { unsigned long gpr[32]; unsigned long sr; @@ -78,48 +62,4 @@ struct reg_struct { unsigned long nmi_sr; }; -#endif /* !__ASSEMBLY__ */ - -/* These are the assembly language offsets into the reg_struct structure */ - -#define R0_OFF 0x0 -#define R1_OFF 0x8 -#define R2_OFF 0x10 -#define R3_OFF 0x18 -#define R4_OFF 0x20 -#define R5_OFF 0x28 -#define R6_OFF 0x30 -#define R7_OFF 0x38 -#define R8_OFF 0x40 -#define R9_OFF 0x48 -#define R10_OFF 0x50 -#define R11_OFF 0x58 -#define R12_OFF 0x60 -#define R13_OFF 0x68 -#define R14_OFF 0x70 -#define R15_OFF 0x78 -#define R16_OFF 0x80 -#define R17_OFF 0x88 -#define R18_OFF 0x90 -#define R19_OFF 0x98 -#define R20_OFF 0xa0 -#define R21_OFF 0xa8 -#define R22_OFF 0xb0 -#define R23_OFF 0xb8 -#define R24_OFF 0xc0 -#define R25_OFF 0xc8 -#define R26_OFF 0xd0 -#define R27_OFF 0xd8 -#define R28_OFF 0xe0 -#define R29_OFF 0xe8 -#define R30_OFF 0xf0 -#define R31_OFF 0xf8 -#define SR_OFF 0x100 -#define CAUSE_OFF 0x108 -#define EPC_OFF 0x110 -#define BADVA_OFF 0x118 -#define ERROR_EPC_OFF 0x120 -#define CACHE_ERR_OFF 0x128 -#define NMISR_OFF 0x130 - #endif /* __ASM_SN_NMI_H */ From patchwork Tue Nov 1 23:05:35 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: 13955 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262073wru; Tue, 1 Nov 2022 16:07:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iomRFaekGQ7KMd1e0wWmyO3fri8Cffub9MFNZEE7iMD3cHVZx4/BQ1ARAHRgSpewvnWm9 X-Received: by 2002:a17:902:f710:b0:184:7a4c:fdc1 with SMTP id h16-20020a170902f71000b001847a4cfdc1mr21523790plo.27.1667344047827; Tue, 01 Nov 2022 16:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344047; cv=none; d=google.com; s=arc-20160816; b=aIShpYrdhwAE2ZDfOiGhe9RzYj6TrT+aNa6U3A+I3oP5TSbpGJhsexqzjlSIZ5+6DO zjAwD6a3I348l/wD9uPIJxLljLNVEAeaQgGm3puyEis8z+nWxh/qqVdxX8jui7FQcQDT 3CMJ1R9wzVe36Gfd8/eheyav8RW+bMDcIm0n1ltn8OmID+ukPim3x0TnoIqM7JukMWg2 jYRThght23lFTJpy3p3bueFY3BtwGN8B7d63TMHYZy9HBgI/4YMlsspy+r+FObmPo7mF EzUbItkr1NQcBWTLbdCWJVhO6bycQiXYlSt6U2eWSqb/HCdHDZmyp2Wxe+V8Vg6YekrH YWVA== 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=4EiPEBWxP+XvbCDkO59EOEywKMyPLB7ijEdADJAKUms=; b=xDs41YyEQMuOIeC/VROPInQd1vHnU6W7iby0NrV/gBRlB/gTKw0DzIO9/VO+PtRwf1 JgeIrCkZ9uAX3niF/NRrlEBvDOVdsXJh+hXTwRFrClZPKno9jhLNlrWm2asUutDSNjF/ BHledA8XHwPOMvSBZauF88QNPUII/oXcGiW0eTZJoSkbv373pcT7AqUnXlMVyF6ZMruI yac7xrsbHcgaYNE9tx9FdZW3/lJ9T+CIXzPJpg05R6sVQEd1zPW2nHuAGrfXe+qEPE4b 7FY/qTEEhoyvcfNrionlfKjPMcI6tnZ7k1g+UdWpreJ2VxIJMkQ17zokyh/aDNj7Y8fz lp6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Y0XPIdnB; 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 y13-20020a170902cacd00b00176e85e5ceasi11666666pld.405.2022.11.01.16.07.02; Tue, 01 Nov 2022 16:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Y0XPIdnB; 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 S231429AbiKAXF7 (ORCPT + 99 others); Tue, 1 Nov 2022 19:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbiKAXFi (ORCPT ); Tue, 1 Nov 2022 19:05:38 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30D3117411; Tue, 1 Nov 2022 16:05:37 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 782E45196; Wed, 2 Nov 2022 00:05:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343936; bh=O4KPNylQ43Tq0Q+WVMGVMq6UXo84JvS+hpJnQ0AYxcs=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=Y0XPIdnB5KT0bAAutzRKGAbR4kutjWShMT1woG1DXMfHvaZ8ct/NohSb4838sVmKw h2xm+WI5KDDK/pAA3eyXr0GVJGC/lKVZL81WMfL2qiQSde+A/cEXyPLiA30TRAd+yT TY8qiHW+zZCYQHK9TMrpYLD+GeEFUmToWouR2uuJkks2PJJKXdamOYriwqmNRqjQeQ AVFvTMVYadzf8EVbuFadj4XiyTUyTi2ysn73WBmigvkK9EMQoomQhghkfjElol9Kts fS4+gPR8WvZdWr6CJlm8U88GwmKT3o5d1oB5xm9Ff3avt+quT8ljge4E5QWi0o5Oyi dE2C/s39oIefSAJ5bwQt/fQO7siO4OAMUJmnScEYAMkBLKV91+KPKFQmGRstTUVwq2 Uym9bkCOMkilvccfJ/pJQVAJawDoaJgk/th3qPG1O262v8akLKwsxL+ONvDuPXcI2S VfAokIgImDyLLsk+CLH0rT2UqDG+5dbO9jrTUtodNh8U4KZ6syKYfh6DqYdbG0K/Br wFAY+irRiijfeAAI9K2istGCp1ZDMQGTanHoMo1WmdlE8OHAPNepoY+jJ8LxV3qsUv k8s9u0/j6gLTHRziQyI2Cv8jsmQXUqKmEl0yVrsp2n1a/HHcsqgzWtIlKAj6t+fXtM fYSB/8s6hdaST1WsW4a/FW0o= Date: Wed, 2 Nov 2022 00:05:35 +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 , 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 v2 08/15] MIPS: IP27: remove KV_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336952099008024?= X-GMAIL-MSGID: =?utf-8?q?1748336952099008024?= 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 Tue Nov 1 23:05:39 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: 13956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262095wru; Tue, 1 Nov 2022 16:07:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56/6J2avOuvhg9ZRo8M5to10Pou6/J6BLkCMjuFZZUiNjvSFanmOXjxqacGA/reogToyCq X-Received: by 2002:a17:902:64c1:b0:186:827e:a0da with SMTP id y1-20020a17090264c100b00186827ea0damr22104683pli.94.1667344049881; Tue, 01 Nov 2022 16:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344049; cv=none; d=google.com; s=arc-20160816; b=aykvI4YusnHB3ABX//8T3z6h84bv1nzcKoIDcOZzfetdZ1PhD5g7a9p7VC23DuMQT9 Ck/Q2LY0dJ2HeJ11pEF6+hWDcB2psa5al6cEi523AhrmBvGus/yP4dXfohDBzKNsMWUz FTVn4TA1sLTXr3zfWX5Ygzc4llEttoozm+esROvQCRinLQA5P93EqmLJxLM6da/Lq7bj sDpQ6TJl+WlwlA1OsorLxdY4EelcxVMb66nE4l15z2H0gE2nYTYWSUIYzMxGNaH7fXU0 6GM3ax3XZLk7QWErdDXwBgyLBrQQUUKR5iMn3hd46pAlqz+pwOrSQOFonsjpG296B2JR WpdQ== 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=NIlbeP92KjCMNZtX7jLUD/AGU+UHt6tEM6nbN4VgTOM=; b=kPuVuThRmHx9ke3mpXBvhbJT8fQOo3y1hsgUZF5n2GApEGAppTmpVeZq/RlE6J0xiV f+hlAafllMO9kGH06MuJI6cyUIoqXx8rKBZ4tlIxlCnjwddaR4NwLYmMab6VW/AKLNnn cVIB4iICLnC8DAvwjF02X3J2ITk4CIMDYctfu29vs//8c8tSumSK02w2K4M3XBgEyG6w Uk0x5s945DLnU3uJG0x2DGYldbjMC+qE94/YMkdx706e8eSLCZ+a0H/wfKy+4AcweUDs 01DSe74wUhEPCvQozuxaOiRcY6N5IUDjOtwG2TVZpn2BO43CkGg2GQ8b1l+8ruAMJxN+ TVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=LbFzW3tI; 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 qe17-20020a17090b4f9100b0020a7e0138d2si296567pjb.50.2022.11.01.16.07.17; Tue, 01 Nov 2022 16:07:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=LbFzW3tI; 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 S231223AbiKAXGN (ORCPT + 99 others); Tue, 1 Nov 2022 19:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbiKAXFn (ORCPT ); Tue, 1 Nov 2022 19:05:43 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A6D2B201B4; Tue, 1 Nov 2022 16:05:41 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id EFFC14EF2; Wed, 2 Nov 2022 00:05:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343941; bh=lR8M22hMDuWVHgEQasSfSc+6twHse9gvApvhgLw5hgk=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=LbFzW3tI/aQnkUbAh0fMtVsgclhaPJJyU9odpcUVRzyodlRf3Am5SAzJoBM/whsda 4UpP9Goexk+DmUfs/zsVXdcuaOTCvqRPPwOMJ+H2fRmNBT/G/whLJQnmdwNLx9/oYU /uF57j99pwX1PKiHqzCZQdk4OMdWzrzi6iLEP91MMETk8wdmrtmPB22XYnUP8GFMXT Zp9+LQcIZyETucailYMzJlMni7scUIz3mB+yPevsBoB7EFENNpSeWicJJP83OXP0Cb Zk9MMr2SIXB8T7WH6AqK0bh95TF5/YcgV884yvkmIC4leJsWuUrdH5COE+rdmH/0+R hnUsdlIcDyV08TKShotui7i2cESKZNNqDnFAaQ7zXzIZwD3ZeX+uOE8+HLVIl39NpB 3r4p8lLoR9/+Vhp0ycdWskDG/tCxAKw3FuNQlvNft86QXQnD2dY7O4j39Ir2Pfuw6K k7KtdMBXJZIpIFCLQVbX8ejXN8CU6ZtCxvL2ZXlwLw9U+s09PxBsfwwceFbIjokHZ1 nUig8mCUMb8CC64+BpWlO2E3gli9+SAxjSxaBMj7EjWgj2JN3LDl+cmmjNzaKbVFFX MHIJwQC/e+xjSF/uAQ1vRjly9UWORGu5pgYZshuMwY7kbp2/09OkzxGa8QKvdrTy4K 78Qq3jEGSmAGKjbDG82AM3fM= Date: Wed, 2 Nov 2022 00:05:39 +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 , Jiri Slaby , Kees Cook , Josh Poimboeuf , Peter Zijlstra , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v2 09/15] x86/APM: remove APM_BIOS_MAGIC Message-ID: <16e8d8d655122eecca13dea536f637923b7dfc88.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336954623414328?= X-GMAIL-MSGID: =?utf-8?q?1748336954623414328?= 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 Tue Nov 1 23:05: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: 13960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262991wru; Tue, 1 Nov 2022 16:08:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6iE5UNbf7gWE9P9KEsLclhq44N8ST9pAK7Lq5KlFTGxo1rbfrfxxOFwj+wHab42cqHoKpg X-Received: by 2002:a05:6402:2c1:b0:463:bddf:a77d with SMTP id b1-20020a05640202c100b00463bddfa77dmr4441048edx.277.1667344139348; Tue, 01 Nov 2022 16:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344139; cv=none; d=google.com; s=arc-20160816; b=G+jUQixlhTa9wBaKUIrAkv3JlY/+EuyT1BB/UXfUWTJXcpfVdNX231Rxn+9Ayx3tiR Vd4ElE7I70Jeb4OQHmg4VCB8fJM6G3gk9em/6D21C2r/bee7L081bQTIcgUtSf2slBxW MS40IMSDafEA6jQB2HFD5JCGZAK4uC8c+awXSCG5VfP7296gxsF/uIE2TdrTqpYecVhX +Q131lHS5T0RSIy6mLAklUHJdgKa03U9nY5ZUEH3W5bSx2Insbb6YL1FluxvwWEmOCF7 p6xOP/Yb9VBZNLAwJtM6nt1eKwS7r4qJUCfZ8J4wp4/wr7w1PxpWCtzcpWXx9PDNTZIO x+uQ== 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=N2+NKBL3U30SlTKH6VAk9C4m8d+tEHqkPgLwb4wyCJI=; b=SYYaXkTN8EJ30U+dbGjoUrwpTEFhYGOiilxXPbYUgLC2qvkJ21/JGSHsR09dqY2DRR +MHbfhuYwtw9EGuYBac4j2FVByPtZH5TsgCx+eLw9JWFbJ9T+YdFespfXvMFDI7sACih i77Ygfx+PZCx+qQQ1SEUIio5iFyZQYQsH2sshtU487TGuezybjOxjxGK6DtN75CdPVY2 ORCUXOBL2Lt2EEND2YqLcldKkGI2LUdwU/xWpaOvNnhYskIEMBi+ls/+IowbMMRGbhjE aEXcJFOzIxMKMqZSOSC/uvzmie4QV58inucq1pcBEE0O/tFEFXGMbJrVLzeOARGPaCIm vZew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="F3/Z8Z03"; 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 j13-20020a05640211cd00b00461eb5cdcdcsi17431210edw.23.2022.11.01.16.08.35; Tue, 01 Nov 2022 16:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="F3/Z8Z03"; 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 S231405AbiKAXHR (ORCPT + 99 others); Tue, 1 Nov 2022 19:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbiKAXGF (ORCPT ); Tue, 1 Nov 2022 19:06:05 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D6476444; Tue, 1 Nov 2022 16:05:47 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id DA5594E2E; Wed, 2 Nov 2022 00:05:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343946; bh=KPLxLEvEsq/B2PBaYPKenFHyW0xpBnqpgZ5eCop6z4Y=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=F3/Z8Z03YwtWXHw61U/ZaoHURISnMiZOPPyYEzBYpWlJRAiPbluz3d7S+ISXrX/xF MjoRv/R6CiWv+wDz2QK/STrpfwH0BWfPVHI4V3iP7sKTc4fJQhtqPh03IQ9DU+S9uI ulviDCARR7cNi1rpIIFnMBHQ+EFzsPdnB7Wc4PfAaCyLxXgwn2mtbjrjUeE2udllk4 am/HfmPXXNN6OYPI7ZA6bqFVsm4fSgeteHRNVLYRCOlRTHgVTMJip8SvlXldWF5ppZ jNFXFOqnjHkADlHKEnptboM7kOCKKB1ooP4Kc3CIGQQ4LInA32FU6yRW12K5cPrcb+ DuPiWBEDxvM8BKYu2a3YKg8jxluyPv6K/JAePc6Tl9yK4jy2SpT/EIPS91yfjAzsHa O1Q+BtGCNDhJRiJ6vKcJhu9kAFdzwvuLaJiGzZd1F/mVSfMXiOzXCAn7pXjOq72Y5s 6acAXYJ+hS0cMO+BvDzclwfer4LEIOcmizZPaQOIh/9sMTP9w9kqhcnfWt4+K81U2x dTXGkMygcODlR4zfCkMbyZfhvmnDJhkxsXbLE34CMxL5zXMC2xwG0FA3ZFFL1jwW2P YT+p4dT9+YtV+9lyiS0/jCh5s1JfPK/YJhHvXxxKF40tlYmess6rheeSHSMaP4QE9u c19XJii0gy41/ycQZl5Y0i5w= Date: Wed, 2 Nov 2022 00:05:45 +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 , 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 v2 10/15] scsi: acorn: remove QUEUE_MAGIC_{FREE,USED} Message-ID: <7e9abe0511428bdb665eae5b9517a0d45e72de75.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337048459587975?= X-GMAIL-MSGID: =?utf-8?q?1748337048459587975?= 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 Tue Nov 1 23:05:50 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: 13959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262717wru; Tue, 1 Nov 2022 16:08:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dNg8cik1HHEcfmWZOZSCS4ooVoNmsig1HS9ckDZggidcWj62EEdQwZZEBynQoM8QtPp4Z X-Received: by 2002:a17:902:8212:b0:186:a260:50a0 with SMTP id x18-20020a170902821200b00186a26050a0mr21551968pln.157.1667344112010; Tue, 01 Nov 2022 16:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344112; cv=none; d=google.com; s=arc-20160816; b=hyPkEfjBUsd9/ly6QDbOflhSACKdW3yc4rDzhuDZl7XfHGkmcZD8ivMJPu+imZTfCR qbOa7Jq/Adv9YJac0mp/PHa5LrxB7dBlVJaQsV6AutKpMYfQb1QtTFyqlqHshkimheLl 9YGFt91076fYwaqtiN32lOfuBKBZVRb6woGwxOg996leJGFEltPGfS0KP9m3veY8vck7 g4rvgUqIJTUGmDOxeFTqGRHUwKXK0YP1xa3pVAq83ooSji0y8iBI9rKaBBsUxXZPYfLC fNwAAdoPbW8KHT/R6uVmLODiaWW64dBbkbdZ4Sqv1EszrHCxGei/psZCZjec1V/eZh4O 82hg== 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=WWV7pijMMpmwZSzoLsehpTXPuoVkU3MsYZrwlaXFv5g=; b=XB+N+1tTQ9QVvxqiV5iMrzaoUXHYnNsqQwu4JKZrlckkvOcYmcdT1C3wItUUWj4HUS 0+Zc/+lLdv/PRLpN/f/lhB5242JAyIKVnZ5synjYeMJR8vFhKG72fwUh65mET+PtTnrD jBBDTIVvI36oLYLuDSvT8Crde7P73guwVJ781+LFWLySMITpOWFQn4oKWFyP1eYL2NP6 ukavyYhCifwekCZt9QSmiNyZ03onxSgAMMMH8Yr7YMn1XKVOT3ZJBcd6ZN+2WJOhusHw 57IhPVzw/6cRa7aFtfYD4Q/Qzk8cw9Em87ciBwOzNlOLHYrOMcfDILMZUpfmKC1nAp7B bIbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=jRaknn+S; 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 be9-20020a656e49000000b003fea0415b5asi13530947pgb.834.2022.11.01.16.08.19; Tue, 01 Nov 2022 16:08:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=jRaknn+S; 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 S231501AbiKAXIA (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbiKAXGQ (ORCPT ); Tue, 1 Nov 2022 19:06:16 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 079A12098A; Tue, 1 Nov 2022 16:05:51 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 356824E34; Wed, 2 Nov 2022 00:05:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343951; bh=DTGJTbh0Y3OZJ4sMCmhd7AQI6rV6WGDqYy9+7OtkP0g=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=jRaknn+SVS7PT5GviE9Sxf2OAtvKhNWKfthc8UvaNxbB/SWX54frattUzN3lvGPAw c8XZJjH165y6r7hcYSAvh2tSkEIeEbMeiRgJXxyS0kkHliwNxvexRKW8JUPDRx8BKq JtGxag4wGnoKneMN+jQ0gl7A6o8t9kFks7vLTaPvAL5WrULIf6aKCI+PND2q0NHnT4 3uvcAd1xHm68J7j0m2a0tkvwh/WfjMWAbTClhppRpK6Nipw3uHuT0KHtposJXKR8+w iAaCIE5u0pZO2dwtpEag/Jy5fbEegDuWozvZMIM4byIOwq/E/PTKB0ABWB8sHMtI21 jtQGh9QyAGtnU65X77KX+xqk8/FSnM6ljxOmOgV3G1ERkhMefA1BkXUbD+nPpbVt2a vWzJUzd1AZ8MffL7KtCQP3VqRvkHsDw2cnEQ0Fu2PiiU8Y9OES+WHvwHp6I4GcpAaK uENUpqg/7agizU8LSK9DgLulwzWvPd/a4D/HQ/+5BqBclpWb1iRhiG+Y9BnqcrewrZ y8vp+Zyre1ob7cBipUh05Iz8fh7keNXvTMiEi/3yCwplnUuLU93irXdJwtJ4aGs7HN vPCSnVE9/BP+gr7EZJB8m/SRL1r1Qa2MBTfsqVlXxQ3v0jz0xH5W/umhycNLNO20xb mydErc6Nm7kfRBFK4ExBbDnE= Date: Wed, 2 Nov 2022 00:05:50 +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 , Kees Cook , Yury Norov , Marc Kleine-Budde , "Jason A. Donenfeld" , 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 v2 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=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337019209562076?= X-GMAIL-MSGID: =?utf-8?q?1748337019209562076?= 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/ 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 Tue Nov 1 23:05: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: 13962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3263215wru; Tue, 1 Nov 2022 16:09:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4P8oQfWSLirumv/blWY3Q3LyaJx3N1xHOHGJyTOZVYcYPocPZlRDS3hFrVgFNWUhRsfh+J X-Received: by 2002:a05:6402:440f:b0:435:2e63:aca9 with SMTP id y15-20020a056402440f00b004352e63aca9mr20883932eda.162.1667344160427; Tue, 01 Nov 2022 16:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344160; cv=none; d=google.com; s=arc-20160816; b=lsxzhqnb44sZGcFHlastTyPVwAEskwt78MANA2Ww5G62pYSFpYHd1rdVLxG9N0C3A2 5u1MVcpzxL8ToNgi4nZrMQJLvriVKYDQx1Do2TQQ13+9GVghKURHvnK/yFE+xs9bo5Nf aiBYijDqsRkh3MzTVrsnisTm6Y0OHILCddkQKUfEljlRQRFydYAsGyhXJ8pj0ShvjMtm Bq48nHcS/40X3VaRm2Jig9ebzQONLzdEr2DYlMWb0OzLgXn+lCWay7w7Ane+nCqCrOoM g3/BT4ePAnHuZ+whWHM10zim3D6/i6503ZMkpI5jgEeYQhSb2HTPnH9Fn6TxckwtYcmB P+tg== 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=1x6+1lMMbPaLBsKoOQnEmX9v74Yrhdi8y71xgyhC37U=; b=SZb6vhOPyHWdQcHXzEqXWQ5MESXG4tN6DsGB2e7+3A6S3f9AXfRArrF90pzkF0PUIU btcNrqpRvPAjnDZ4xT7RYcpqBGK01tI1UYZkiT1TlaLWL/TgLvmzqp+jfbgsd6lPCSzt s66xc/BlzOVHpS2gsOfZfXelIGIowI4XYOkt4SD0zDX99FNhVmzRO5p+rjOXarYmJd0l 9k4qIMGcU0QdI0V5HK+2C+NNwwKssEfCJ15Y2oZWL5+w+MGTkHH1I2ahmwPHoDFcBPih 1vfIUyll6tjnFc9NmGmtmkUrLAxUDLIuh4HyHVG8M/UsZTElD6+zYQO3psJDPy0eYzI5 M6Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=TdFzXwTz; 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 oz8-20020a1709077d8800b00782f3e3bb71si14014769ejc.912.2022.11.01.16.08.56; Tue, 01 Nov 2022 16:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=TdFzXwTz; 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 S231367AbiKAXIG (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbiKAXGl (ORCPT ); Tue, 1 Nov 2022 19:06:41 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6675E20BD8; Tue, 1 Nov 2022 16:05:56 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 8F0025282; Wed, 2 Nov 2022 00:05:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343955; bh=rw3lhRXMa/Ho52bgtMfPJ8t0Tc28iEsnbyGMRu0CPRY=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=TdFzXwTzQpYqv6vHwSyvuPwqNeeBukttQEQCsTB+5IadCoOnkIlGepS0baOBPSVIM HJKckRzD1YVk5emJH4lWcknZlVLrepoIfloLtsRFXyplODDOS3lpib6crU8k1Ol0MX JaoZiFGaH6b9wE8LMb8U66cyzV8As+bD1pAmetdXsDmvOBWxeVllAYKwPzAst0yVtA TQHeTaoJW3tdeCoP/GvZICXJ7v5zxfiqPnYglHGfqRMoL7p4yqtzAVKZj4dAnRpF2p qrcSSrwHJdLrYbeGLm077/8NHaDBDknlSjINk0DKBByxNRYFbGJIRyJXk9ENXUeQyX /Jfmzsc5NepJX0nhzmE/0uuFYhIBcaFwZ1cUDbdgdQdkrWZTH1xsUbA767FC7/hQGg n24nDgodDd9jfNXrOsFA0aKn31J4j7kwQnkf19lagjSqf9NIhwwhaBqQ6h4IuKeI+c nN0udfZD400yybauHP86ro7Ky9peb3B5Fsy7lqY6bNaegBBHJIE0THO90aC9L6uN5K LWDIpEo+oKc+kaZVwV1iieOji33Wce9DG5xUeaeAGceJFtlEWbNRVh1jHuM6lwWoaA IsNrOH+TfcYxh2+KWRlH1Nk3miOOnMLDdPO//Q8eQmwlKdljnCnT/67XSpEOPlw8Sn zSFob41a31IF+6+LkLs2bnfQ= Date: Wed, 2 Nov 2022 00:05:54 +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 , Duoming Zhou , Sebastian Andrzej Siewior , 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 v2 12/15] drivers: net: slip: remove SLIP_MAGIC Message-ID: <091907215b5f648e4e01f32e8902c1260101c1ba.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337070430917507?= X-GMAIL-MSGID: =?utf-8?q?1748337070430917507?= 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 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 Tue Nov 1 23:05:59 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: 13961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3263164wru; Tue, 1 Nov 2022 16:09:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7icuuK7y6O9QFSFiXBex45pHUjJgMr/qZTThdr74j1qBXp3sk//mlRbTbmn/bc+oYDQqtJ X-Received: by 2002:a17:90a:de13:b0:213:eab9:5e38 with SMTP id m19-20020a17090ade1300b00213eab95e38mr12130275pjv.44.1667344154883; Tue, 01 Nov 2022 16:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344154; cv=none; d=google.com; s=arc-20160816; b=lsIjcZuy4jUMlL4xgGkMPI0UV3i6uHCaiUP+rdXGnVMWDmzT2iSzY8hq11i4334+T6 NgReezHsmfT7XntW63yNfRx5gcteJ9yPYSmteS06sFzPrzU8ClO6iZEUfnAGzDhKDZDO KvG0sxrO7k0cfb/+4WVbfaXhQo8I/hrmdq77AdpEJVQdzXQswrh0V7t1dWnEgLvEFsDj VSfYeNSRoHInmMIYGdG+OBDPzxvP2YGgVmRn4HRY4EbirtmGjQn13PS2478F0zhRhT1r C6YjbKoTmGOtjIs8UEWvNOjIDHwXUFn12B14TY0fnTgPnbpQvA4R6lehw9xtI3kw+b9F SjGg== 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=6WHt0mtfO1UKQ+KFHwgYrwBFYmEhPVLr+lnSic9AUoM=; b=zw7nAqx/qDzOq6ueIQk/QUY36fdW9oPXJiGqedNECeH+VnKXdYe1v2pQevbyKyE4Df sP2dxh+4QM0ZC1asexvMte4CNV7uwDrMmpebbHei4L8efydrNwh7rcdK653il/22hc39 5Oz3Ba58kcTNPdPBHbubFoMJAtxRa+8JqJICwNXEh9CiaTphDRSDdWoWu27czaEE6APv HMmz3ZpGwWuE9FWyUcS56XPDi+zofwF3JD/EA4QdUVsR+v6GoDSB9FyQmSdCFAXrnh9J M0zXUVQuxA5pUp4/O+WQJ1pdqXLtohCQWLF233dGnfi3uOwVfnkr8OOSzxKLO9LpKyQX VJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=J7MxYDRL; 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 y13-20020a170902cacd00b00176e85e5ceasi11666666pld.405.2022.11.01.16.09.02; Tue, 01 Nov 2022 16:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=J7MxYDRL; 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 S231437AbiKAXI2 (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231417AbiKAXHS (ORCPT ); Tue, 1 Nov 2022 19:07:18 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEAE820BEF; Tue, 1 Nov 2022 16:06:00 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 2389F5286; Wed, 2 Nov 2022 00:06:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343960; bh=vmmcp42QtObiMdAlKV6ZcArvn+plUgooLi7XBv1lrRc=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=J7MxYDRLE2v0uq1I1HK225FrXlrWP3CJv4z2yiEKHOMU5v9B/nVVU4s2AVxF1jb8T 340hKkecVNR/xMD9fRJtdGn8vTrerEUS3yATdhhsyX4gxhgBSp2MCVZ0Vu0eM3+M/4 +AKo7pi2VgtElBfTG2dACp5fBCX/yv5lHMltespHc8Dmo51BnAED7DLkH/Rlz+tFY3 4RsjWuOs+4vU0NTRPM9aQK+aUM3cD/h9u1FtKBm3tDKbP0Jfaey++VYbRaIThz/FQO 2Pgfhe4bnDdWVINinco2AEAkahS+JsuEPh42vdC7zlCzw2kFPA/qiaZHIaF/6paGDE g8uv1DcVNkpaxzeeMW+VMscVjg/BT0fS7wO/FQeYotYqIHaMIXkx4JRz1PBaQMYBux xo6TzoFLJuE0RxwTyAE9NUwps3XUu8IMPFbXyTCzDAgC5fc29J9ckR+dd6jwFWQ6dI mNNpBohJi/0pH/9D2QwActVv2Nzys9oo+CkkuhuK4z0nmtHZUR4ek53G1izdBOAxA6 hEjfLlCWi8eYE7McOp49P1wbeXuZtFJcJxzJyXKzVHL/WaKNmqTCrXlDwoPnesuKSC vVOmwHfU4FW+AeE1Tqzs4UdWMMXtGbxjPDdgc6fnkUnNHLcrqfFvSjP0KUGMlD3d6q pCdZ0G7ScEOvyBOv/tXm1hNk= Date: Wed, 2 Nov 2022 00:05:59 +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 , 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 v2 13/15] fcntl: remove FASYNC_MAGIC Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337064663941163?= X-GMAIL-MSGID: =?utf-8?q?1748337064663941163?= 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 - 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 Tue Nov 1 23:06:04 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: 13963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3263216wru; Tue, 1 Nov 2022 16:09:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51TWFJiWAJl5R+fxUYaO2X4+OQfxh2U+T8dRZ4e2BvbbWDZeI53nmwLDdy6ETlVaZGqt6I X-Received: by 2002:a63:1d59:0:b0:46f:9448:1559 with SMTP id d25-20020a631d59000000b0046f94481559mr15710918pgm.284.1667344160329; Tue, 01 Nov 2022 16:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344160; cv=none; d=google.com; s=arc-20160816; b=CIiBCaAQmpq/GXurtv8+xQo6oto7SPK2kQBnij5FFuz7zekAKNt2lL9WyC5oK8vlAY sCIYetyOYPl56Ul5olzCT0/EbUXfrw9Ph1lo+eZpgVPsr1NM8xxObskAlwjRAsIHCSMs s8X0X+OuVJGydD7dzDibmSdgRkolFMW+YhPS52JzEqmycEAJlhiNRuLI1Kpi779XOe2M /5NpPdbl6pnLVFnHIIPkDbizcOpmxE/FxX9HOP9yIFM+rBsBYuF+NflR5PiaAlIr3hgb TzrM5hkKE47UKhzt7/lhCNMmtUchq4SzoIOBGZ7Kb47eVPXCjwbro3Uqo3sN2dcVK1zb ttiA== 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=RVezxjw01M4ffpsXvam9OYBKl3eHB7/hD9NCRCUdUwA=; b=h0gP4FOKd++TSflwI7bDlDXYJeZMS58nw4X4GdOmsHWpfTW/uYWFywuz/LP9hWcjkL UUH3MqCMUUT807X6cVN0v/mAjGZEAXzTQZJeuBHRlYuHCY55uoiYugWmjjMNkpfU8xjE CE4WMKDU8kv3RDVpY2fStBgk2gik60+MnIbhHrM59rX4spaXYw4edGfMo10/1OK5S/f9 2HEl1T5Ed7/Hto4OjSRvGrEq630qY0kuZV1AQChqKxplT8R1D++wI+74cxx23wRUBRyH 9pEtTdyA5KfysM0WBkxNMhHIgdf0DGjPMtpCOmL54V3BS7mZc2obHFqoCX5lj0KuPeZy WoMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=hNnV2gpV; 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 11-20020a63194b000000b0043966935b33si13417572pgz.166.2022.11.01.16.09.07; Tue, 01 Nov 2022 16:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=hNnV2gpV; 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 S231482AbiKAXIe (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231448AbiKAXH5 (ORCPT ); Tue, 1 Nov 2022 19:07:57 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF45CDFA0; Tue, 1 Nov 2022 16:06:05 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 232CB511E; Wed, 2 Nov 2022 00:06:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343965; bh=oRx/tqbhEodcmennLfawsLB/b4V24e6OIzyts+HKR3U=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=hNnV2gpV5tHEDRRHoILgNh5IH420ewDM7/rhtqacniaYzRXfKf+20hKobmRsOCTAT VeCCPMIbW197OCnxWlu3ODYlg0g3PqiP0V0Hb8f2YQg7PGxhBXfCdhHOzupd05TeZp 7fCMzBlsSN/L8gsDoNukSUje6tbudSpau8JxTtAdyHey8c8YVjn2fYeoVQuJcxcFGB KX99Up1ue7GGurneWtMCshmrOwF2W5Igb6tTXt3x2qoiMniE35t1TYbwM4GKxb+SUU L4N1s177lXYZuMs74UWXmBqPWrFEZ4fUzDGzU7jdqG34tAtRjhuEQUjfWEuPecBEDA b4IxtCR79F6t8SZ80gDxpG6yDyxQl4N2KxL58yyFvJuG5zE/EvcjuU/+yHpmT7BIvZ mTpiNfRsBTjx2m53taEt64Sy02FZHWc2yrlK79eWSg5ZGfwfp2+lmqOp15KocXFcm8 Cob/qjXoRHHN/QHr9C/xPLM/PYe/Y2r7fSMXjUplJ6MScx31YZ7TEnavDvbiL87RUW S59mG/dXrFs5k2MpQtrBzZN1yqoBSz2YeerVhvulilEyOjb5knUThhRJtqsEv02dYm /L1wTlNJjdMGZ0BpGnaToAKF2aRen4sJeJLOVG9iO38tU70Or3DbQ3581SGshCsB4r t1DTSywO61Y1WTjqadmS023A= Date: Wed, 2 Nov 2022 00:06:04 +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 , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-scsi@vger.kernel.org Subject: [PATCH v2 14/15] scsi: ncr53c8xx: replace CCB_MAGIC with bool busy Message-ID: <27cefe163e602f7d5b35ba2e966dccf9109798f9.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337070290609480?= X-GMAIL-MSGID: =?utf-8?q?1748337070290609480?= 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 Tue Nov 1 23:06:10 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: 13964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3263949wru; Tue, 1 Nov 2022 16:10:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Wy13jP5lnPbpge5ED77plmVYEbAL+1Oon+CVMi82LsN0Moln6paHlKnKLDVbWBNuBFcfS X-Received: by 2002:a50:ee0a:0:b0:463:4055:9db4 with SMTP id g10-20020a50ee0a000000b0046340559db4mr15376346eds.421.1667344233889; Tue, 01 Nov 2022 16:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344233; cv=none; d=google.com; s=arc-20160816; b=ajlz0JMK3ILejADe6jkk5dHQ3bAQXLgOuNebgQx3hyn5pNDa0w/LGzzUmLLVc7xMjn 7Nn5lTCpylKimZNMQaU2hE8aWWgTnvODi16evsgyK/h6jnphQWdVuLgxm4s94a3OO8a/ GEtAOVJ9486QOxVidfVyIgQc/8RbRLdMd/NAFS3PPSfENxTGJAfU/cXyFgyyC9UMkG2N jfBW/LxIElzCmBYmPl7ieT8ewy1s1+tNY5pDcyHv9iUDkVpgqx07Fw1II/+P8A16kVK+ z2lbuODPetuU35u7XonOWOzNBg/WTClcvyd5o5uzRQ3z7BuoyaIwyT38ljcwDeNC4R8o IFag== 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=PTvSZcskimIE9N0tB8uerc8wdVFHoXmRs9SghUHFWlk=; b=W21jYiLDdlxQWlcBZ/4oWui9dt6K0AfvbO3wn4+6rzvH5mqb33eYAnldMaPzYsuO2H +4Tv0/qd069wqEeckujeFHzyzPxxDSN3NKUZMsg+J0UFmqE02ofGybAZfnxIRJsyw79A JVRSBCz38RAJRYPsam61w8o4Z9Ly5otVZFuAg9CYmo55ftt6EqzbpDgn57cc8J9aOkf0 Hkbv6sfIxvpx+/68ZK8xzNZ/gy2ePnUXcg+cYlMnLL4FMKORDkvgUjwqEEAUGLZ4jK7E 8omwIAXfKPi6YNEuEvmYuNwZMwNX8X8uYSLXkbBZBiYCUQsvjhc3j+oSMGFW/6/5Y9hW JJiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=nCyC+CGL; 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 hp22-20020a1709073e1600b0078db89b2566si14333926ejc.699.2022.11.01.16.10.10; Tue, 01 Nov 2022 16:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=nCyC+CGL; 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 S231536AbiKAXIx (ORCPT + 99 others); Tue, 1 Nov 2022 19:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbiKAXIC (ORCPT ); Tue, 1 Nov 2022 19:08:02 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A22221242; Tue, 1 Nov 2022 16:06:12 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 6110B5120; Wed, 2 Nov 2022 00:06:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343971; bh=zOWhuQMSZR1YwwRLd+QWN0gTTOwavh0dQxdEq8i52+U=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=nCyC+CGLNaGu4ktUXHMT9DnA7nIyCQPHxXPxXIgTmpQRFVmAgFrJxMZgfbUaT4wYL 6ub9+Uf7pjrDBWg+Kmpq9DXKnk4hygcNe0tyI4mKQUUN3Q6EWlx+UvVXxydYQbLc/M 8oi/kHrp2FJv2h2qjUqZemF8yCe5lE3EC5PS0c8Zqq7I34D3XnpSta7+K4Tsrbq5LH 8FeApUaYYpUU9UjPu6zLgiFUk5eEbkM2s/SvvuwHmR6vdfL3CGafTh35lOY4AX8Vry ThR3KVmzslQyqhHrkwyYgHetY6NdDZb1lS5wXRmmiy+DWCkQfPBFOkqGspdv8qJx1/ hI+TZ3jOjnc/n2XD3qyQ88huanZh0iHSCle62pTRBMc1S5OkvJcFY3hoVk1VO64+lY gQTUZndqDMDq8op3jaL6Ij4HTu8hbpIOYZOiMDTEXLq58X+S0UShW06KIp8ade1PYn wqXiBd9khl5Qwdv63aJEfUoATDadMOhnTDKmyGizDTUZerqg9L7xV2TGJ5fouvVnyc CmaoAU2TrPO8yOTxpaONZBeE1/laO8Y70CE2uI2K0h+e2lU2I0arQhqDqWA7yWEiNB Ol9WIgLIgQzsFIJXWAT++k+OYkE61izdXlBDogXKVV6boqEi+0OXYroWhq2fS47Gmj wvQNLB8vv/7K5ZiJ2bt5Q/FU= Date: Wed, 2 Nov 2022 00:06:10 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Steven Rostedt , Jani Nikula , David Vernet , Thorsten Leemhuis , Kees Cook , Lukas Bulwahn , Greg Kroah-Hartman , Jiri Slaby , Wu XiangCheng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v2 15/15] Documentation: remove magic-number.rst Message-ID: <9ebd25ab51a3b83d5d68edfe8d11a8b2c4b59f01.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748337147332374124?= X-GMAIL-MSGID: =?utf-8?q?1748337147332374124?= 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 - -===================== ================ ======================== ========================================== -魔術數名 數字 結構 文件 -===================== ================ ======================== ========================================== -===================== ================ ======================== ==========================================