From patchwork Wed Oct 26 22:42:37 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: 11449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519084wru; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cCwnUH6s85R3IamCwgeZnvierv3OyaSApoUUfj2j1+w37vPAzdmtjZl4I7D7sR4I85vTS X-Received: by 2002:a17:907:a073:b0:78d:51c4:5b8c with SMTP id ia19-20020a170907a07300b0078d51c45b8cmr38509654ejc.355.1666824279115; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824279; cv=none; d=google.com; s=arc-20160816; b=d7Np9c9SDmjLf76swcWEwBkcUHkZgJVY+acOCgs3S4ZQNyJ/lnXVUKKG00ZzvjWvUT tEPwXTg+caYKk0icAF/YceW/E6o/HgiNwO4CdV26gDdTqppt+0ZjxnpMsI66oo9aLPNg j3zlB3lISw4iaiRcN4LlF5liIBC/h+2Ns7r9y7udCxuLYlt7suGtxA67nTxeSpDbvAn/ kdRubvocUkVnX0nyh8V/KL1D56rqQt6uAoVG0z9vlyO98ESizqFllB2sBXphZufa3jKO u0J3Fy94Yl4Wd5l+ZhFLtFA9mFbc6T4Kjl4G4Z+IFYGf5qXCmz7v37q5XlvWinCv4OEq jwUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:content-disposition:mime-version :message-id:subject:cc:from:date:dkim-signature; bh=19eOYi5T1XuaSSCCFPL1fVIkj2jgVYRC+wY2aPpmv88=; b=IRwcaMXWDepN0BlL0RMt20o868E50/0M5A2S6QQLn+MUyE3CtTa2cifTWPD2lf0dmc WoKje+mBsoKGaI5fWjUDsC/mgtLJ+ikOItzQi9nb2Oh2YOauIaS91Exj3yjA+QPSkYHV Viwtq/yz835HbQAKkJboSaEQCcsr3OLIOpaUHMhKZePMaCEPVYwKtyZxbiqLESnnnvxq IKzJgd5wA5/eKWmc6jMru1SmJiUxAesVOvhoNx0j61YRY9VKvGkCqdzai6Dh8GUvBgo9 ueQ9nPeDzPVDqlFxBF+8G8OcpqS2SlIFd7pZ+5L72g4tQDD2RUMjsR2dGYlulSoUFmnb Tl0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=ewqx1vKt; 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 h11-20020a0564020e8b00b00459b0141076si6203272eda.465.2022.10.26.15.44.13; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=ewqx1vKt; 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 S233548AbiJZWmt (ORCPT + 99 others); Wed, 26 Oct 2022 18:42:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiJZWmp (ORCPT ); Wed, 26 Oct 2022 18:42:45 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D0A9B2609; Wed, 26 Oct 2022 15:42:42 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id A76FD4534; Thu, 27 Oct 2022 00:42:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824158; bh=aLDkrJ3n4mm7gAwDMQ1n4CJ0WOrIs4GD9cxoyIWSHEI=; h=Date:From:Cc:Subject:From; b=ewqx1vKtJ2h9Xs/DjWq85Dry86Wfew+vhiXIRdkzk86GMVDf+5li+FEsrHjL/9LLQ VBa55g4H2bKpmI4eeD8+RHLltFVX4lhzg3b4mdC9sq0rNxaPMeBfE7YREQMCjzlA0y JyoB5hXbZZNDx9UAgJ+xvTDm3qqumpKAhllTKnpj4a1wTFmmHS/7p9yrZm2gs9SxZ8 zFwOabAb2vdLsdvUTQ6iWPqcEml5W2qiYpHzcXBoRL1x20N+rw0dtZhcBJ6kgfR8f+ 1clFKDBwenPDRIsvKwWqrEv5QkqJjTgT+0kT5ItEZmB5NX97+IRv/c4h19jY9kW4Z5 +1UEWBoqTnKEYM5pBrNuVNUAFJFLukNajVU82LMOCFM0Bd9GPgIH+OhnN3t7kgUgOz MUa+O7E6gkYrKbFpm7FWrxaQQ3hlTI7n2cLaWgXH9k8dA+K1fndkigwNYYT9/+RdLR 1RMHEEtyQHvb3JQX+DNzz1pVbJxU9qEjgltYWFFwq9uyHavqgJUurW/kFhdi/1TFle /QCuw7sl+fRIu8Cj8tva28JAQZATa0IiRaaHGsS2NfVh+OrdgYV0jUDuBnQPeNYxPa RnCRBN4HkomBC9QABLw0d+lCY9NyLzgFbNpuZ9SJsscvu5cpF86yvwEF43j0OCKe0c Qme2WH7/5D+X9ytYjVPPRb68= Date: Thu, 27 Oct 2022 00:42:37 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Thomas Sailer , "David S. Miller" , Eric Dumazet , Jakub =?utf-8?b?S2ljacWEc2tp?= , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-hams@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC Message-ID: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,MISSING_HEADERS,PDS_OTHER_BAD_TLD, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791935418687768?= X-GMAIL-MSGID: =?utf-8?q?1747791935418687768?= Since defanging in v2.6.12-rc1 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-2.1.105 network-based driver Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ --- 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 Wed Oct 26 22:42:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 11448 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519083wru; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46kSO8v7v4Qn0Snpw8RQGKWsUo03xJa4W7Szy8TF5e7tuny7HTdy3KXM1WQTaRMOqM/eMu X-Received: by 2002:a17:907:d22:b0:78e:2788:51ae with SMTP id gn34-20020a1709070d2200b0078e278851aemr38439705ejc.689.1666824279108; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824279; cv=none; d=google.com; s=arc-20160816; b=obfa29RdifA3QbyF5zPasBbkiOB6L9v97iGUGDxPS/285pfIKcRQa2sR4bF88Y3GGV lBQf0S0srTQsFc1n71fvK9BeDYIW0PSSCtdDUdGHIkOcuDh4nG3vmRQx7cxPnCGfOQcO /S+GTLXFNvCdy5+Ksh99KGgwLNal5xadfI395aiQ9hpyzt1zrjcpfJ0pmMO356EMmLyT a7kGOGxsO++zarYObGLmmWPJVJTE8qJYOW4ULz0fNYqHvMcLNLkBfyUwiGelahxOBJtd W98pcMrJmohKNVjHJumDcEgG43VLsGY7xyhKjBaa/zTf0lqedilTC+ypnY190xGXsk+Q JHcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=FySuW4JImM2e8WSAtUL1eyK3K/zsaQUQkfO4wWtJCks=; b=uXE3BdKTu05atPLZ3AyEw3KmiSr3sqthXqILqXFSDsuogmwM+aOirZ6OKzP4pZiAPj MmY2BscbNnGMPSxn7HXykv/O5qENzl489HCrS1+iPkX27ZhISSXdfA3mXsem/eebGvPe J/gTtIT/ZcU++THVk2prmO93bKX3GZmJbNqm6m8B12SLuJTXSCUIpUnQB7VmU3lNzioT 9SqguVIeOiz1yrY1ABV0o/DZHDWMRloq4kQSN3VvG/Oc3bzvc/d6ZoSASUIrukKD1zGp 94tAktHoiZ805t6WmyMz22gprE2OS+lyYjSq8xyfXUZNPyKuUS+D9svgFbuXWu4XUJJY 9vbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Haqz2ZBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz2-20020a1709072ce200b007771bc8dbb4si7783981ejc.781.2022.10.26.15.44.14; Wed, 26 Oct 2022 15:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Haqz2ZBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233664AbiJZWmx (ORCPT + 99 others); Wed, 26 Oct 2022 18:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiJZWmq (ORCPT ); Wed, 26 Oct 2022 18:42:46 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 584DD15FC9; Wed, 26 Oct 2022 15:42:45 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 8C76C489A; Thu, 27 Oct 2022 00:42:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824164; bh=jNoxRVdm3VuLTQW8ZXbhrbrxzP5u0X1eFmEP42xyPEw=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=Haqz2ZBzsh+Jl1+IFXYjMl5ZH9zqy6r2e9vFJ/0gASL2UmeLSV76EJGhSqdvsZCQC tylCmVInrFF13IwmNkkeQUYX7SunAbTq+mkP5gJiYJd8wUJZkZjwG2NagF80f842TC PhCyizqgHCE4F/i1Sy12+84rETqN7uWVBfKoiEAXGXdBrl4WAyp0nKEAjsno5Osl7f HgfB94NpgOIGSaqFVqDLnCK9v5oKk+ZioSzh40y0mDxmah4ECxUrILygeSvCA3q0HP /uF5hGjOu/a/lSKcSeRMGt3ooCRBdG24vnibiglDFeV4rJUTwnGWEuyu+YPdL9Gn9K bTDkeB+1iWh5XcR2l1Umd2/zi8wSnNrFDtnIDcseWnxaAoAArdj5SVp7aADvFKoRAw bt9704/LqzxScH+b52PUCPzVai1SbeamrfsI0Q8y1ea1eVfBY7l7BRx0DFw5DKpykm 41ZVdmmWpJNC+vfEd0Fifk1554D87zlggjrYSwArkKk9V5pWG+lJtsx+pXfXUPNbdd NfEjiDsHAUfQoPWOQhYt9Nb3FEH+BZjlWQWYRuy9heJ9+IcLfMpYvcrCr0QDf8Ri3e OSglN2vyNpph+KPYVJHMP9NTAtodk9boQ4hCA87krHpqL0sRKWQd6n1sPadXMbiLh2 QWLUCT7y7EYZ0A0MQkmAUsos= Date: Thu, 27 Oct 2022 00:42:43 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jean-Paul Roubelat , "David S. Miller" , Eric Dumazet , Jakub =?utf-8?b?S2ljacWEc2tp?= , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-hams@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 02/15] hamradio: yam: remove YAM_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791935522969814?= X-GMAIL-MSGID: =?utf-8?q?1747791935522969814?= This is checked inconsistently, only in contexts following directly from the module init, and returns an error to userspace/ignores the condition entirely, rather than yielding remotely-useful diagnostics This is cruft, and we have better debugging tooling nowadays: kill it Signed-off-by: Ahelenia Ziemiańska Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ --- Documentation/process/magic-number.rst | 1 - Documentation/translations/it_IT/process/magic-number.rst | 1 - Documentation/translations/zh_CN/process/magic-number.rst | 1 - Documentation/translations/zh_TW/process/magic-number.rst | 1 - drivers/net/hamradio/yam.c | 8 +------- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index 87353e0207c1..a4414b7e15aa 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -76,7 +76,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index a96712bd8a68..f51c5ef9d93f 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -82,7 +82,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 44f3a29fce57..3b53bd67e41b 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -65,7 +65,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 0fde3183e82a..7d176a87ec3c 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -68,7 +68,6 @@ MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/p HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` KV_MAGIC 0x5f4b565f kernel_vars_s ``arch/mips/include/asm/sn/klkernvars.h`` CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h`` -YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c`` QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c`` diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 2ed2f836f09a..0f43411a6ca5 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -73,7 +73,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define YAM_1200 2 #define NR_PORTS 4 -#define YAM_MAGIC 0xF10A7654 /* Transmitter states */ @@ -94,7 +93,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \ #define DEFAULT_PERS 64 /* 0->255 */ struct yam_port { - int magic; int bitrate; int baudrate; int iobase; @@ -604,7 +602,7 @@ static void yam_arbitrate(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - if (yp->magic != YAM_MAGIC || yp->tx_state != TX_OFF || + if (yp->tx_state != TX_OFF || skb_queue_empty(&yp->send_queue)) return; /* tx_state is TX_OFF and there is data to send */ @@ -930,9 +928,6 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __ if (copy_from_user(&ioctl_cmd, data, sizeof(int))) return -EFAULT; - if (yp->magic != YAM_MAGIC) - return -EINVAL; - if (!capable(CAP_NET_ADMIN)) return -EPERM; @@ -1079,7 +1074,6 @@ static void yam_setup(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); - yp->magic = YAM_MAGIC; yp->bitrate = DEFAULT_BITRATE; yp->baudrate = DEFAULT_BITRATE * 2; yp->iobase = 0; From patchwork Wed Oct 26 22:42:48 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: 11459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519859wru; Wed, 26 Oct 2022 15:46:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5m7pbsZjsQcOFwrVLK6aKcE6EHXzEF1T1fsCGuiMFqz4RXUWWPmdULsNP399TeOeILf6zp X-Received: by 2002:a05:6402:2802:b0:43a:9098:55a0 with SMTP id h2-20020a056402280200b0043a909855a0mr42138465ede.179.1666824411160; Wed, 26 Oct 2022 15:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824411; cv=none; d=google.com; s=arc-20160816; b=KJ2bK9LXbJzp2dLEcsyVXHTuGnwqK4CfqC9EUaKolOTZ/2ih3ritqGZ5h1cfuAoYbk D5D9QiNz75FY8PODCzRVLQekfJRRgASKneERibsPtEqRGO6dHj4yx3zuv2mi8i+AeNZ3 o24te3tV3ULcpmPuQR1VvWDkqW2Z5OfAc5Lf4JG9/Bn9GFwVgFv26XAmSa1hqXHIChun iBJyr8rbJezOr+CyxhvLMbtHaP47jl20kYd2qUxwkcc8WqMTb8Aa6z9Q1kD+reKoKzKH 2ageFb3MwZ+PQOt7PpYknKf+nk8TPdRsNnVZHyDwndEBXnmaWeHQIsKGXfL4ldezAyh0 KqFA== 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=R8PArDHfsdFEfSluH31s/dMVQJEGJ6i4SPEI3btJuXs=; b=WJeoaeniYTiT62ZLFCNjcEJbsV5VUPBM7g5fsUgoTb10VlDgx6JZAB6lOP8l22fIRN BwIgxvbKV7JU1eU5dHiSsJBjk/7oaLGmOhZ8m9dIJipS3E1cN23E2XcnRAFYHbQ6cMwl N9LLTxkzh71dQxL/qy9QxB/6lPYcTw4zgAfBmsT2MfrgAnn6U4C1hbAehknnklA52yfh W7KW4HipJkybutR7sItu5jRPJgkc6InhGQbZvtv8P7lElvGAA/qZrDd2hCy1ghHjB+zG W8FAPYN0p40FYzSvYKJ0P6dqt0SFPHdyytba/iioOPRGqCRZP+2GI0dwQJqHyArfWJNx 842w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=eInDpVGu; 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 dd18-20020a1709069b9200b007836ec6999dsi7161266ejc.904.2022.10.26.15.46.27; Wed, 26 Oct 2022 15:46:51 -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=eInDpVGu; 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 S233682AbiJZWm4 (ORCPT + 99 others); Wed, 26 Oct 2022 18:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233542AbiJZWmv (ORCPT ); Wed, 26 Oct 2022 18:42:51 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 062DE1F9D5; Wed, 26 Oct 2022 15:42:50 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 4B735489C; Thu, 27 Oct 2022 00:42:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824169; bh=z+Ch54k+gmevbiInJZ+ZMJKFOWNNhIeKTNXpceivE7M=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=eInDpVGunEUvT6dYehv5m3C8ThSDrmXAle8/b0GhcaOXgnk8vOBUNu9XLZb8+pek+ kfdbYHXD6YjL29PPocHeAJlf72Q93tsvXtk++Mm0aOJh3VLtbSYPxD5vAkRjVvEISA W6dwoMyhg/uj4PVn43oBdbDNZJ4zH39CJLjQiF/hVij0Mq9wrQs3JSyVF0dYU4lIqQ 9uP4CdzWQGvhkpvj0qBg2/LE0tKDEjkcIx1mYp3aY6t4Bo90fNr/TFzF0RkImh7jbg zzW2hD6nRo4DezdHay25upYcBvroLH5ob4rGsWuXijYxriKyo88uCyGbBvMzBqq7/p 5e5lNipu/ItOeddN2EdDKYUvdwHyTOdkB9rtn+roh7K0ivwPftz9BeLaszEygqGwzK E0Y7wEvdr1Kw2X8soctrl8sQHoSrsK4/qADBC7r1sKWudwn0CqQ+BiDVGiOATekxyy /jt362ZP/qYm58AmF/4X9bmnLFspedhKOSvOtcVbgycFY6q/bIWoYAEGppF5AzJ6kl 8jE7Krr/5WnxpvtTAHRA5wYE/Qv4+oxU3VLD9JBV0W3Ku7jW4xHNGE/fxv7isAf7h3 hp/LETvRJpptE3Agk+qeft2GSVtkoxZgCDD8xT8yWqDLDjnykmJEtrJGkPs1nFN0LP /0mpI/ZPHJZmMuBoXpOZNvhQ= Date: Thu, 27 Oct 2022 00:42:48 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Arnd Bergmann , Greg Kroah-Hartman , Jiri Slaby , Ilpo =?utf-8?b?SsOkcnZpbmVu?= , Johan Hovold , Haowen Bai , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH 03/15] pcmcia: synclink_cs: remove MGSLPC_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792074124829559?= X-GMAIL-MSGID: =?utf-8?q?1747792074124829559?= 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 Ref: 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 Wed Oct 26 22:42:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 11450 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519166wru; Wed, 26 Oct 2022 15:44:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DrcEaTFd2RBix29qTt5ewm0YsUUgeRzqRoq2fOxCM9DVxTRfCulnUUtAxTmzz7CWOaP51 X-Received: by 2002:a17:907:2c59:b0:78d:8e03:134 with SMTP id hf25-20020a1709072c5900b0078d8e030134mr38663089ejc.310.1666824291891; Wed, 26 Oct 2022 15:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824291; cv=none; d=google.com; s=arc-20160816; b=J4hNalcZPoYdvJJWswLpWdHlXoFRfYKUBa+KRHDhjeHCjgUiqX1Hm+7D8hU3P7+Nx7 COa9jFONmD329EaF3pNVowitvT8vuPPlTr8j/QRXIAlAGBgcrRLN9Jpf5kU2i1MIfvSe w3crKvverfK7nZ+cxj40Yh7OvldLxLMnWkGBhVc6Ij+aN7MEY/n9qcr/GIdtTMZEZiWS nmaUWjAAJkNBhBqxu2bS7t3mHZynTjQbWStK4ZLzTcdA6W1r89F7kHphFxYPSgtGMzmT 8uJhdxOnCC+8ciL9KI9EMqjDApsXngmk8XzhymP3TRv18MACRZdJBGeQyXnMuwrHmYel DAgA== 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=SM58FcbuNJwqSsPaOZRUPLOSRkNyAJC01HVLoHUL4EM=; b=y4LbZMrEuWy8NTCVoY+14KhZNEGvxCDjt0Sypdnlijurj85ExWFMrx4mk9feBmheni LYgugWBzioJF9JUdnZ3Cd4SDmeDwRWPS51Bh+Mt5Z3fr0ljA7NYEK+HM8sbTbbVAIG3F /8TxsAo62osa/DyCmfKu2txWrb6LCemAdVtq2QOeJxEMz3L3+WduKQ91uMPzspffx1bh m1wqqEQzM41p4e/MtqdsuMh9BK5sr67RiEjFaRxpt0sw0GNOOFzUMidZly/Rhj1rVjhH vurphMZNzBVb6y0JJASTE1XJyGR0GgC4EOPaW7LY3tOjGxniX0Qq0xB53UWbNimu+OmY Xkqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Iehr94EQ; 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 e10-20020a17090658ca00b0078de536a3cdsi8031343ejs.119.2022.10.26.15.44.28; Wed, 26 Oct 2022 15:44:51 -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=Iehr94EQ; 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 S233706AbiJZWm7 (ORCPT + 99 others); Wed, 26 Oct 2022 18:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233669AbiJZWm4 (ORCPT ); Wed, 26 Oct 2022 18:42:56 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9824E356DA for ; Wed, 26 Oct 2022 15:42:54 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id E4C3C489E; Thu, 27 Oct 2022 00:42:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824173; bh=POnUIzf1npzUTJWLJxHdqxp++JUxZ5v0ALeMnMs/AHI=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=Iehr94EQZ22V2ug75Lmq0a6rPBjGWUmgXEOkpMQcrM6/PNtWezt0LVCjwWns1EwOC fVT0HDU8gnFg+GzFujXo350Z2FhzcotX6EyiYkdVgx4n9p/M9Gre9g/0pi7XHZzBVD ltEcGBzlL4TSjDOenqTgH3Vi/nIsYVguoWS/F4m4LsrBxnPGJuKe0cLc/5cBMVldms +4ixaWsYrTBIn2z2VCPsYJJyI3zPo7YrCMxB5wphuImJMGU+zBCZ9Kl0LLS7+MvI2z XrCZ2KbhPARbRmn0j61XQarO2I76Sslq+rmrlTBRyzP+5XVtFO1sVq7RbHNVU4ciRw u+/jaERqmiSIJAZclPShz1MZw0Qa7PZlHGzFcG8YxeQ52QsiOg50OdBL7IFeTj2K+8 WREzDFPaNXBmYmuiPCRD4JIR+H4SUth176ifJ8xPUufrryV4HK4ogdiawsrhh53+Un Tr6RE2K5g+K8d7JOmbxSUQUf1avqplF/PayqKAAGwNc3k0A8sUn2697I8HwJ78tZGx +14iGTmriDxP0hSljfoNm2d0WI8YohGPvJEPWdrJqKyNEzfa4v3tMZjP2StxwzQFHC HeS4vOfkbbYffc44fg/hIHoRAzEm6hn6LImAdGQYnjCKBpvwgmEXjoAg779DyspJiP vL7ES4f2G/7Pbhz5NccQNob0= Date: Thu, 27 Oct 2022 00:42:52 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Arnd Bergmann , Greg Kroah-Hartman , Ilpo =?utf-8?b?SsOkcnZp?= =?utf-8?b?bmVu?= , Andy Shevchenko , Jiri Slaby , Haowen Bai , linux-kernel@vger.kernel.org Subject: [PATCH 04/15] pcmcia: synclink_cs: remove dead paranoia_check, warn for missing line Message-ID: <051083d29e5812608deb034dfa86ae0c583fee44.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791948770099235?= X-GMAIL-MSGID: =?utf-8?q?1747791948770099235?= MGSLPC_PARANOIA_CHECK has never been defined automatically, and devices with null driver_info can't happen, since we reject the open in that case Move the log statement from dead code to the check, and log the state inconsistency like we do above for the line count ("invalid line #%d.") Signed-off-by: Ahelenia Ziemiańska --- drivers/char/pcmcia/synclink_cs.c | 71 +++---------------------------- 1 file changed, 6 insertions(+), 65 deletions(-) diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 262f087bfc01..19b6118639b4 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -644,25 +644,6 @@ static int mgslpc_resume(struct pcmcia_device *link) } -static inline bool mgslpc_paranoia_check(MGSLPC_INFO *info, - char *name, const char *routine) -{ -#ifdef MGSLPC_PARANOIA_CHECK - static const char *badinfo = - "Warning: null mgslpc_info for (%s) in %s\n"; - - if (!info) { - printk(badinfo, name, routine); - return true; - } -#else - if (!info) - return true; -#endif - return false; -} - - #define CMD_RXFIFO BIT7 // release current rx FIFO #define CMD_RXRESET BIT6 // receiver reset #define CMD_RXFIFO_READ BIT5 @@ -694,8 +675,6 @@ static void tx_pause(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; - if (mgslpc_paranoia_check(info, tty->name, "tx_pause")) - return; if (debug_level >= DEBUG_LEVEL_INFO) printk("tx_pause(%s)\n", info->device_name); @@ -710,8 +689,6 @@ static void tx_release(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; unsigned long flags; - if (mgslpc_paranoia_check(info, tty->name, "tx_release")) - return; if (debug_level >= DEBUG_LEVEL_INFO) printk("tx_release(%s)\n", info->device_name); @@ -1476,9 +1453,6 @@ static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch) __FILE__, __LINE__, ch, info->device_name); } - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char")) - return 0; - if (!info->tx_buf) return 0; @@ -1508,9 +1482,6 @@ static void mgslpc_flush_chars(struct tty_struct *tty) printk("%s(%d):mgslpc_flush_chars() entry on %s tx_count=%d\n", __FILE__, __LINE__, info->device_name, info->tx_count); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_chars")) - return; - if (info->tx_count <= 0 || tty->flow.stopped || tty->hw_stopped || !info->tx_buf) return; @@ -1546,8 +1517,7 @@ static int mgslpc_write(struct tty_struct * tty, printk("%s(%d):mgslpc_write(%s) count=%d\n", __FILE__, __LINE__, info->device_name, count); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") || - !info->tx_buf) + if (!info->tx_buf) goto cleanup; if (info->params.mode == MGSL_MODE_HDLC) { @@ -1600,9 +1570,6 @@ static unsigned int mgslpc_write_room(struct tty_struct *tty) MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data; int ret; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write_room")) - return 0; - if (info->params.mode == MGSL_MODE_HDLC) { /* HDLC (frame oriented) mode */ if (info->tx_active) @@ -1632,9 +1599,6 @@ static unsigned int mgslpc_chars_in_buffer(struct tty_struct *tty) printk("%s(%d):mgslpc_chars_in_buffer(%s)\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_chars_in_buffer")) - return 0; - if (info->params.mode == MGSL_MODE_HDLC) rc = info->tx_active ? info->max_frame_size : 0; else @@ -1658,9 +1622,6 @@ static void mgslpc_flush_buffer(struct tty_struct *tty) printk("%s(%d):mgslpc_flush_buffer(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_buffer")) - return; - spin_lock_irqsave(&info->lock, flags); info->tx_count = info->tx_put = info->tx_get = 0; del_timer(&info->tx_timer); @@ -1681,9 +1642,6 @@ static void mgslpc_send_xchar(struct tty_struct *tty, char ch) printk("%s(%d):mgslpc_send_xchar(%s,%d)\n", __FILE__, __LINE__, info->device_name, ch); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_send_xchar")) - return; - info->x_char = ch; if (ch) { spin_lock_irqsave(&info->lock, flags); @@ -1704,9 +1662,6 @@ static void mgslpc_throttle(struct tty_struct * tty) printk("%s(%d):mgslpc_throttle(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_throttle")) - return; - if (I_IXOFF(tty)) mgslpc_send_xchar(tty, STOP_CHAR(tty)); @@ -1729,9 +1684,6 @@ static void mgslpc_unthrottle(struct tty_struct * tty) printk("%s(%d):mgslpc_unthrottle(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_unthrottle")) - return; - if (I_IXOFF(tty)) { if (info->x_char) info->x_char = 0; @@ -2160,9 +2112,6 @@ static int mgslpc_break(struct tty_struct *tty, int break_state) printk("%s(%d):mgslpc_break(%s,%d)\n", __FILE__, __LINE__, info->device_name, break_state); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_break")) - return -EINVAL; - spin_lock_irqsave(&info->lock, flags); if (break_state == -1) set_reg_bits(info, CHA+DAFO, BIT6); @@ -2218,9 +2167,6 @@ static int mgslpc_ioctl(struct tty_struct *tty, printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__, __LINE__, info->device_name, cmd); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_ioctl")) - return -ENODEV; - if (cmd != TIOCMIWAIT) { if (tty_io_error(tty)) return -EIO; @@ -2312,9 +2258,6 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data; struct tty_port *port = &info->port; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_close")) - return; - if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_close(%s) entry, count=%d\n", __FILE__, __LINE__, info->device_name, port->count); @@ -2352,9 +2295,6 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout) printk("%s(%d):mgslpc_wait_until_sent(%s) entry\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_wait_until_sent")) - return; - if (!tty_port_initialized(&info->port)) goto exit; @@ -2412,9 +2352,6 @@ static void mgslpc_hangup(struct tty_struct *tty) printk("%s(%d):mgslpc_hangup(%s)\n", __FILE__, __LINE__, info->device_name); - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_hangup")) - return; - mgslpc_flush_buffer(tty); shutdown(info, tty); tty_port_hangup(&info->port); @@ -2468,8 +2405,12 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) info = mgslpc_device_list; while(info && info->line != line) info = info->next_device; - if (mgslpc_paranoia_check(info, tty->name, "mgslpc_open")) + if (!info) { + printk(KERN_WARNING "%s(%d):mgslpc_open: " + "no device for line #%d.\n", + __FILE__, __LINE__, line); return -ENODEV; + } port = &info->port; tty->driver_data = info; From patchwork Wed Oct 26 22:42:57 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: 11460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519862wru; Wed, 26 Oct 2022 15:46:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ht/IzPf17gdkCgx6K5dXb5pDH79hOmvYl2CUUkoKL1ZsOZaK3Udp2hdzGSz3Z9GGbvj1Q X-Received: by 2002:a17:907:1b1c:b0:72f:9aac:ee41 with SMTP id mp28-20020a1709071b1c00b0072f9aacee41mr39470601ejc.56.1666824411460; Wed, 26 Oct 2022 15:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824411; cv=none; d=google.com; s=arc-20160816; b=o283z8G6TRB96DeZ87+7dwCgKCilBMVcGnPQ81513v6isUbwdhW3mlthwyYOLuCj/8 V0eyh98Yn/vrNxEV4jF2k/y46Q648Zrv2WhQE110aPrxTUVugMjVhlgmUNVcDpAp3OQp /4nzKcgZ5oi5AxcD3qDVcx9+1R8MIUgGK6J1kNXCVciAbOZMzMHPH7FngIkNWpPsDIXr Z9pY+RXpZgqdtTuMGqiqDugc2n0oq1njOaHKQipK/Lxu4E9lD0R0QAEeMGUh5ThnZjfI +A5T09oB/wer0M6JlEcvL1dwR2y+8/yFD48ammQgQobbwoto+K8x8ggVqnncvCTgp4/k oHyA== 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=q1ghITQi6m0JU2u5fkQADrog1YffIoEvyXONsIprbuQ=; b=aXnpELyk11yifs45VJ2wisFme2u0ovpstw+BUt2WrAt1Vti2AGU0EbTaCeofbmXdBA vPdtX8aVqcZP6c7y/MBDOVgDslJBaaLdOBdu31uycU4jIUIF0Wjimci5H6v2ssITtZfG EM5j6IeJOB5H109ite7woujSkBK2UCsXp+x+2a0ia/Xzhza5dvSZyI0RIY+TTuB3fpGO XfLXMagbwy8jhnMI/krAMsUaKRh8hTrhKKfM/6iVrFmFB8/t44ZqcDYO+rSWwrVR4zL5 CSpmIaEe7V/8oxTJ35Ik+Cs1UjTvIlOgqCDtR1UqpaDpQ7jVaoXI9F9nutdgnPmcUV/f xWGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=Ljrgv533; 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 i11-20020a1709064fcb00b0079330b37fb6si5817278ejw.880.2022.10.26.15.46.27; Wed, 26 Oct 2022 15:46:51 -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=Ljrgv533; 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 S233764AbiJZWnX (ORCPT + 99 others); Wed, 26 Oct 2022 18:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233705AbiJZWnB (ORCPT ); Wed, 26 Oct 2022 18:43:01 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE2E5BE2FF; Wed, 26 Oct 2022 15:42:59 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id C253B48A0; Thu, 27 Oct 2022 00:42:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824178; bh=KJDVdPnwAEb9wGIso9S8xIg1kNqM2rqj1xsBTAC4c84=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=Ljrgv533fOq0Ozbfo+BjELxBUX0sRag6Wt/YaMEZb2uSVDHOGNtg3JBmuqaaKD2Rh fpU5iwAOjZlWqvTn85xF+A326d0gr1K8PPKYXtBpf3xTktT5dGkOdmRCnTS7H2kPmc 5/ylmcotlKRTG02cjUN5mU+yoaOAKZdNI0aoC2eQS8douQiroPBrbX5Y5blye7Mcem Kn8pKp6dPD8FGnP4bD9wqsePORnpvk27VRNoJrsSuIRQb+Awl3+mPeoUiS3ozoYhyy x8yjC56ZTGSkFOOg3ZpI9K+LSK4Vjsv7PH9UiNQ6vN4A2dtXssnEiwa5arGt/+VaW3 w0/4r1FRbKKJgIrkF5PHIepJGTppmhJw9y+QbxqEjRkz5yAgNL6B85fEcxmXGPu2WH VREB/N+d1bUPWv51x+6viOybX2vTxWb5YmQU2UQTvIGiinbGViS1KCxwBpPs2Qgk5i /9GWGb0Gt4zpNVXwD1ljW8Cx3qg+n/QCbVVAW+LM1yPddLWY5IVsU7CJsbVkB9UUq6 ZV5FRaWvI8iBhVquNGyK4sy9CfybtDBCtQgLbGyTWhWiSc13OEP+yQdPH+vkiIj83z VX1V9bulmzeb8NmhGQBC0ouyP1gYnZq+6ZPYPFI349lK54YTw2I2o3FSwyb/yYMrK/ yzINNG2FyAI2o5BttB1/gaqo= Date: Thu, 27 Oct 2022 00:42:57 +0200 From: =?utf-8?b?0L3QsNCx?= 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 05/15] coda: remove CODA_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792074184126283?= X-GMAIL-MSGID: =?utf-8?q?1747792074184126283?= We have largely moved away from this approach, and we have better debugging tooling nowadays: kill it Ref: 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 Wed Oct 26 22:43:02 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: 11453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519383wru; Wed, 26 Oct 2022 15:45:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46yHdw28L5MAu2vvJx67wL4/y1a/CB0xZnSDCeq+XSQ0WxxLlH+1pXmiRB8h0/5dW4h4j9 X-Received: by 2002:a17:907:980e:b0:78d:b6d8:f53c with SMTP id ji14-20020a170907980e00b0078db6d8f53cmr40487668ejc.70.1666824325782; Wed, 26 Oct 2022 15:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824325; cv=none; d=google.com; s=arc-20160816; b=x0yjf41mmplf6m1YmpKqa2Susze0od67P7EEWLptBX702ddRlJtSvjjJNnY8g87JYp Xk5tOeoqcivIEqdxsZ2jjPxZk5izIQzxV0hmBOA6jwmKpk2SCJI2MCZM0PaCMTF1ioxd Mf2bUQYTr8wFoHTnBs9I9D/J96d9llKLm+ZLvvm31uE7D0cxHC3ZkgDfcoK0azVRChvJ DKamxgY76W3PHiWieyDRwSegt/MZmyTIMksuc0cR9TgWYyEVKVLs6tHqPwY1YooioLj3 A5ErBJwJC6sYS8oTWdwOV3wTfSWalxRAKk2CIWQ5cJh8SunvtFLFHKAo3MYX0gJYIDCC oENA== 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=gW/qCwGD7KAGeCe3UIg2ytzYCKmCBUWwJcdqHlhTHms=; b=V0IMSjw2R8MWIea/umxXpM+e7mYJcke4W2xbGJGZmLUszAdMX6EqsCFES46pOarjxA DHA3PI7Ogvbndkj2uCKBjrVaS9d7YyEyJLvSgPdALM4m4lh8bQ3regp6mbC+18a7x+VZ PiwHibmuiAUOX2kff4T5rILehaL35poC2gBdOPdn/L9f4JbMdJryFh+j9/4LtUgJemw1 AS1GSU1MyFyV9Y8ytuZmM3773X+WvMBLuSmZOxXtZLR4eAN52xQKedt44sBieGEmrRfj CPz4NrsicPA4nn/W95u8OpcPlRB4df/r1N0FsIQPOGpTWMZPvbJmwQg7GhhuL/TXYnzy Q95g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b="bN7s5X/1"; 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 s3-20020a17090699c300b00773db392e1esi7535947ejn.997.2022.10.26.15.45.02; Wed, 26 Oct 2022 15:45:25 -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="bN7s5X/1"; 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 S233782AbiJZWng (ORCPT + 99 others); Wed, 26 Oct 2022 18:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiJZWn1 (ORCPT ); Wed, 26 Oct 2022 18:43:27 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42F39108266; Wed, 26 Oct 2022 15:43:04 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 4F97448A2; Thu, 27 Oct 2022 00:43:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824183; bh=cq0nhezhJlKkx9tdhb8PRFcZf9zYzKZW3hU6v6CxrUM=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=bN7s5X/10y860hwLRfp6dfpT+PB+gqrBn11CKNouL9AGZoIk8QCrBWcdIE6GinZWG ByI8xGhWewqV/ETqXEadajlVz8MrJ+oUeIFhmxq17vZPUTedn8qL9q0c8qmsfOONSc Wis3SbwZFZJVhs8h24TGuGOSE4Pt0QPND6w8X9aJcfQx3syNY6FkHyEEj34Z9ZZ6vV P467+aPOr7TUCtwP6ziu9gUA/QUIo0u1ZgfFL+lUenQ1ZBdGgrd0pVjoVIFA/bUPBG 0yuKPeO9jWIic0JQcPVOMqKxrx3C6qL3Fu0dmIiY+cdvB/sLl1VD9Ui0Yx35m5mtYB JBuICLJgCGll07dsvpM0ZK54Ld5VFDBmoGdO9CbX1jXBNdmsFA8i07MJ1jjUO5eaEQ Qvk6a1q1tnqs9tp54EUNy56aO1fnAXZAOEcp49uy9pPw/Hjlr1cLa6O/GKP2INFCeN urZeQp618+r8B0+7UTFQc+cAn4ZFCL96xpsDTUF5+wNyJiPtUzJiYtY+xiAxcjRg3i SrdrKwVQ1e6JU2BhgMq4ThK3tHXiM3N6vKbkk2XfXmXsTAlbhsoPVBv5jHCqCPR1wt m8P/5fX05rF/JDqfTa5QJDMe2JLyM6GWkoP3bwwUW7tEDDt5Zp2L/k/JXYrPwHq0YJ Vno54TrddYzFhYJ3Fp1eR3lM= Date: Thu, 27 Oct 2022 00:43:02 +0200 From: =?utf-8?b?0L3QsNCx?= 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 06/15] Documentation: PG_MAGIC isn't a magic number Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791984507411298?= X-GMAIL-MSGID: =?utf-8?q?1747791984507411298?= 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 Wed Oct 26 22:43:06 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: 11451 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519259wru; Wed, 26 Oct 2022 15:45:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48YIpe9PuD2YW5h7ipvCk8ifOVB18LUClz7NVbazuSTiol/bSjhs/Ep/1TpHL622pT9h6F X-Received: by 2002:a17:907:70a:b0:741:78ab:dce5 with SMTP id xb10-20020a170907070a00b0074178abdce5mr40130030ejb.527.1666824307905; Wed, 26 Oct 2022 15:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824307; cv=none; d=google.com; s=arc-20160816; b=L+mGW/buide7IcmSFmDs2fjxa1Y7Kpzoknv/hES6RB735NsFSzY61hJSY4aWEGp5om 4RyFV6RaUwfrpnx+NoPal4IK1cYkRDt7ndcQTwuaYbwjpebopd7G95BdvBW6R/+5lu4z bat7s7MkZ76nZVgDhVyBzDeo5cyIiAC+mkta4+FEI7NgMpHQWDKunDnxWo/FXwOey/ac gHl11hfD3zX/irRfj0qL9sgKaM4qcTqX1d7ZBzcfSpKRKjMQExY01U/EMBAfkVNFxBTH ppzNmwPgH4yqvxyK7NnlEOBGnYxMH/M0ZyZj8ycqmSJGoHdinw826k267WWt4rbc/N0f zi/w== 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=ZwKXfv+gxhc45a7VQKr1rLpizNGvGrccvjaySNf1E/A=; b=nIdOM7LRzP+uBBJqbNTtR89s4vetZ8qXye2y76ZG9bWO28C9hPpE4KueBUKWWfx981 lFiKjdwQ+cfWufniSstNgXKhMejywP+K37o2NZaDEVLMGBFo9edAQBCi/DP8PGw5TV+m c3MpAxDHGmrOYY4HsOctoQFbpQtuGYc1QfrhMz1Xbdes+al1LPw+1UtubSD7KCfJdAw4 V+Ynn9+qJWuPYockEP03N+ACXksLDJX4cChv+daJcWqteFK/Bjp2HcpIy2m+DLA6VoSt MuHq5xPHi2ZWLDJhb3CEAN+7CAPBd7cjbZDYz18Rd9LIFYwCAb742LxPLkT2bJqSRNzV 2F9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=L7s6hrXX; 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 e2-20020a170906248200b007818378f560si5898138ejb.383.2022.10.26.15.44.43; Wed, 26 Oct 2022 15:45:07 -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=L7s6hrXX; 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 S233793AbiJZWnl (ORCPT + 99 others); Wed, 26 Oct 2022 18:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233747AbiJZWnc (ORCPT ); Wed, 26 Oct 2022 18:43:32 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88CCC13738E; Wed, 26 Oct 2022 15:43:08 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id D461F482E; Thu, 27 Oct 2022 00:43:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824187; bh=HaE4IXPdx+zXOUMr9BZGgBKqpp/SrgiEjg+jSxW76Go=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=L7s6hrXXlym5v2if6/tEycFPoqI7Ro7ohFfsKomakdmG0J7ZyvgXdkDpK/SMEinzO KeXJK9Vu2EtbZtz8jxjcsargnEPo/dHpEdiY5U1kXH+3GpAG/aIS3S3krb53d/GAlO 5fjo5xLuteBo6whwP+ZJfaocxoQ1Nhl971iFDlz1gyvEY2yh2zdrRoWyQjqFgEzRu7 55ppghfsJBwtQ4UBbi/EyNWxtm/bVNFfrGLRV9Uu1A/zK17dNAZdYRxtv5BnHTdYYX LOdO0u12AtRvyb4u6DEWdzJBBGn/1kyvd5PWkfJxo9na4FdSyFL5/V5RfDDivx9bWL 2JBbtsqpiFnHLzUrKUorhBRRoKIINkRUYjgIsnoqHEuOtseWNlcNYxnniNuJvtjSJX 6e9GMoAwSbkU7lHGgfnUDqGXNSqE+fNBG8jWBNTqYW1VTd+Ruei4FlAEDB8HhSYaOg xr5+je/zhxRGrUiE3IMo8rFfaFlJOY1L3/t7r3X+B2b4TxIpzLN9B+WO4KXm6NqDM8 cXSMAcSpJ0I3SKi9AI9gYYC5sfuISR3G0D4gqXZ6n93TPxqfNQ89PbpzFn7Ngh3OLu DBczps3Sbl8ssmF/2rgaKZJqVLuFTRzd6BEhZrvc6V6s7gyhAxnD4mnRC30EGAoKdl iDPQuNFEhLwm84Vs4ZpjqkBg= Date: Thu, 27 Oct 2022 00:43:06 +0200 From: =?utf-8?b?0L3QsNCx?= 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 07/15] MIPS: IP27: clean out sn/nmi.h Message-ID: <08c138e14f71c207c4428df9fd31154744be9d98.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791965646822253?= X-GMAIL-MSGID: =?utf-8?q?1747791965646822253?= 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 Wed Oct 26 22:43:11 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: 11452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519305wru; Wed, 26 Oct 2022 15:45:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IWSQqZFlxAUmZgwaejIdV9XOnVRevL2nNMvZcKWQKXrMCaFaEvTVT/fOBgMswzqj83ta8 X-Received: by 2002:a17:907:7214:b0:791:a4cf:5bb7 with SMTP id dr20-20020a170907721400b00791a4cf5bb7mr34993043ejc.576.1666824314192; Wed, 26 Oct 2022 15:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824314; cv=none; d=google.com; s=arc-20160816; b=wlCSJm31KesL3n4xYfU7BS67w/u7Xi7Rung7o2Cwj3eFKBRhTNAkK64JIUIqrU/KLw k+jLUhx0GpakRBh2rGQeu7Ofe2VK2dFlcfqBJnRNmdzSQGUNxagAPTHXuCD9nZ3f0NM5 XE2qg91FwsoxJZDYH39kKHyhbbEGT/KeWrXh62MMWCTCIdVeOxT+7f7ul7jxjLxQPH+X 0PwKnfzKUA5xcMsBVbIH8zHdxC2ietWN0c7baqWdEvh2d+pYTlCVVMcuwTlyc8TbCv6f W1HhD/MHakdzIMVHLoODe/xmx7pohI9B4FpK0dmM8PTZJ/CQmdgkMkaGcFctyNWOI8rs BEbg== 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=KEUBckVEv/IiNuMKEBhl2yOMNSArW4VpXpF+Ixi1Z8Q=; b=H8zwsighDdrs1Zx9f/m5tAgzNlavK2+RTZw7a4IOK1NoSRCWADQbPw+NNoeM7qYxvw WaR6x9OCHgFHmK6F9uFJLcc2+i0Z09J6LFBcP5ykwGcdr9Pj9rscHjfX/10A+oUam8cT DdQ6WiaIWz9fXfFzZZX0irKDaq1xiIpt1v9jlZXaBdBuSOgV0Bx8SNa5vwgwd5EitsQ2 GXinekm7A2Q6Es9a/HZe+xerVvgm03gbp0jtNv1SinwqC/bhAoxuAQkt0GU8i4Z/VRDS rh6skEO7aJvIUqz+PLk1fa6l9+iOQSUAp8/FPiCXHa+rAK0EPWi7eQZu3XOoBwNsITTN zzLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=t0N1sIXC; 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 ho40-20020a1709070ea800b00782686da1d1si7893030ejc.761.2022.10.26.15.44.50; Wed, 26 Oct 2022 15:45: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=t0N1sIXC; 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 S233817AbiJZWnz (ORCPT + 99 others); Wed, 26 Oct 2022 18:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233813AbiJZWnf (ORCPT ); Wed, 26 Oct 2022 18:43:35 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70E9C139C07; Wed, 26 Oct 2022 15:43:13 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 9CEBD4830; Thu, 27 Oct 2022 00:43:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824192; bh=6pkTsC/X3DXZE/1Nfcqo6aUpf8jpMUrgSqAARhHXbY4=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=t0N1sIXCHYG7BMvFda7Y9i2bcXE6p67yVFVd6WfdMLY9915Tv6VpSKFYkKF/H+Rs+ OWR03FlGilVT3HXqNkE0B5l//9jLy7diLyZPOObJNUxr460n4EgKxqHhVAggZPLOTY LdwHziOYdEi0OkGHlOvvJiu8J2P9o0MuBrJwf22Z6jwv/3q4U6TWHO6SzAz6kAk53g KZgH43sk5odPvW08Dp9Mq/82cQBOVu2SodgMOaZ/h0DukqCQ3CcuvvLZi+K7Men3tM Qbw51HcMUEOrRILuaTPM9MtF3JBBQOxGWZyIHkPQEN134EEgbe5vhV4i4K+wIGrqDL 3z3sSrL74sUt4I1xRYLKcQtsud40Vv+DjkIWiJfnBNXmWIqf2iU0F+6N92r8VEN8Lc eP+qjW59Q8R3lwCXE6jVdXGOW+BzVZlcPZWvxGjYUW+lxc1KQpSI2VwI7YjBpY+nC/ gO1ypdzK/VHzFMNTf0Rx6hRJJQlTCehKImwiqtyhYILNof7laAMdziTY0KUVGoAI8O 8V9rSQXCRSN6dSv/dY2DBPTCxYoia5c965CSOQUwCw7cRLxaTFhbHR5qpBiOiPCd6U Ol72bU+1saOpAQWUWyW5hQUpy+W0ptzFh8qQchjE4nBQo9QMxAuKn1bUBPswJaWkCc Y4IAQRR+gQHbtP2KG4w7U6uE= Date: Thu, 27 Oct 2022 00:43:11 +0200 From: =?utf-8?b?0L3QsNCx?= 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 08/15] MIPS: IP27: remove KV_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791971871637282?= X-GMAIL-MSGID: =?utf-8?q?1747791971871637282?= It appeared in the original import of SGI code in 2.4.0-test3pre8 and has never been used anywhere Signed-off-by: Ahelenia Ziemiańska Reviewed-by: Bagas Sanjaya --- 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 Wed Oct 26 22:43:16 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: 11455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519520wru; Wed, 26 Oct 2022 15:45:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51OFuzMP2yksK69Bzd0sJlKiIYUNwApgBkDAFYhMBHvT5LRIqGxavaAtyIffyskalm+UCY X-Received: by 2002:a17:907:168e:b0:7a1:6786:f16 with SMTP id hc14-20020a170907168e00b007a167860f16mr21875044ejc.590.1666824344462; Wed, 26 Oct 2022 15:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824344; cv=none; d=google.com; s=arc-20160816; b=cPTdgvkJYXf/h6LeutqRk/z4eWAal8uVF8t/UiQgNRIbAoRNNUWXVs2L2XsWIhbuEc 5hti3CDCfDPYmhNtuluOk7SDxd5/GF0qPDNaHdqPqHv88mnyvGvynqNk/3jCBHdYsbQA HE5TrR9bCbfRH4Io5Im0XiTrhJW2+ggSDXxXXhF5HOlj/cP3tG6dJ06zLBROpMJfB0sg L+Ws5LqPVT+y/b/qQQK0nIr/AcxfyCHOg18XXP5Cew9SXa+pZ+zys1sT5qS4tUtOLMwK DAICi1mfRoJ2VHtTBtaUyHrLKVllW67NNya/x9LWub5VmMW+G26X1wvoV5lGArayVqY+ c6cQ== 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=7FOgr8Vp0wGw/s77XzoxaT7WTCaUAl9ZNCX+qTjfjZw=; b=wF1Xjv6tJYPNotMItzTjAru8V1xEedxTP5l8DBEpwat+5D49JPXADJoITkICVwCNEX I3mzo8phe+julH/wgkVhzTmKJNBvLmt5TNLCh3NWQVlyqHDVZI9nVk1oOtAkkFJSbagr EkE3epkBx8AZamtiTtE3D6Ucqm3HlQaNypxReLALVF+3+KwHPJdeem23SPpshZeu8k9T z3G954gQeNOaeiCmdoGCVlFXA0qcCeR3WDWw2pTVjRAoK65MaU8knOt8Y1r+bZXPNn3i qjAEH37S53Y5VH1mMI7ilNapKRy0zqAroC8rplLaztjKSHqGQRg2Cnbmy+t1La1T4tGT /cYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=EPwaNgB2; 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 gx26-20020a1709068a5a00b0077f2779c178si2652946ejc.254.2022.10.26.15.45.20; Wed, 26 Oct 2022 15:45:44 -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=EPwaNgB2; 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 S233826AbiJZWoD (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233668AbiJZWni (ORCPT ); Wed, 26 Oct 2022 18:43:38 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F47511700C; Wed, 26 Oct 2022 15:43:17 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 222C24832; Thu, 27 Oct 2022 00:43:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824197; bh=pYNAXn7meYx+O/2Uw04Ex9qd0o7Lea6vZv0pqijKfL0=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=EPwaNgB2n2n0Td7OkYlPzf/50q8c0WbVu+UD9unSG1qXZkzK5aB5Ff/eMQgCTQi8x Z4dx4FNXQNVV/v2aCB/84alz4rTWdc4x3EaqWQftZdf31bWT1vIEhOdAiOHbALJUvq pE+j955+xklyf94i5QAWUctm0Zv787sZrBP78neVqg6rDSZbD7BWjJcjFAfycbyqN3 3/6cHVcQ+5G3MqDFgH38stNlcveoskT5NwXXGYbnAP8yr/zSjblZzdIcrKQujGR9We OvMh9hBBwfowvWIc6Jpf2UmX9Whran88EsqN/ryNGKLiEcI6z5qaPbilN8tbMyKCWV 5PaBhS5D4Ow8rsL7QrdcXr7PGDm4FxmZF2UVxP16cpvzXADhMZ+p39uJAy22je4nea aR0Z51DHzKPNfldYCSvjz5A2vhYtqH75nlp1dQDnjPHyyS0pQVvQ0B9Hm8yoF0oUAt 8Nm7pBym5feZ9yAMIHkik23f7oqgJ1jW1tOf1gCslBcuCUp8oW55SM3Joi+Rq2OBF0 SOraSzFQcY1UO7SocT0xTQ4iIfb+ro4lxJctr1ImrmhoPJ3kuSvVLgCWjQSgr9HLMj eP9jYtobTb7Z6SK49r7D4ImnG7uJfDri+bWx+EGU2qFCLqg0ig7E12gTjZxWBbdKFJ V5lWU+NbU/K44IzwC9XYxQx0= Date: Thu, 27 Oct 2022 00:43:16 +0200 From: =?utf-8?b?0L3QsNCx?= 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 , Peter Zijlstra , Josh Poimboeuf , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH 09/15] x86/APM: remove APM_BIOS_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792003757008159?= X-GMAIL-MSGID: =?utf-8?q?1747792003757008159?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it Ref: 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 Wed Oct 26 22:43:20 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: 11461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp520040wru; Wed, 26 Oct 2022 15:47:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hAPXSiPxUH4kMSBB8/g09hKVyIDMIfZyrPEl4jyOaFB41XjPK/evcyQx4I0IQ8sIi8v5S X-Received: by 2002:a17:907:1de6:b0:7a5:ea4b:ddbb with SMTP id og38-20020a1709071de600b007a5ea4bddbbmr18374214ejc.757.1666824441681; Wed, 26 Oct 2022 15:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824441; cv=none; d=google.com; s=arc-20160816; b=U5a3+du4kCrhLmNAqcYjt+TkR9IqL6pkVCVn/4QUAeCmW4ROze67R7OlWh82pG7gs+ vpRDBHIosmOy9OYhFvPt4wAmcUlx/y59EzHcseUD9SWnNO/x/fvDtGmG/ajwR7QmwRNm uE6mr5hRSPCG38eBgAR15aCp+lbUD+qhwo5MTyezz1RTzCyZmXWh2gPBIKVTLKFRjTI3 Ev6MxUX2bqT9l94hkI+wj7wirMGFgKxciQEaRlxPpE16adD/TeZPlwr80dO2HvBfCZwt QkxVi95CTrzAdqz7DiVmkYRFKPo+w//0jWgJX76HmmpTAJgvWPJu0bxvupvybvk6EXRq NauQ== 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=IPqxSzflyqPKLQ5lJKQO8nWcFOPBJD9q97GG6BYjXvw=; b=NbptZVTo+J0wOxzbNgdoFIoQkLKbKULkwSSzvenyJVfsHgokjSMb9eBqNsqcCyO3Aj 0G20HS7mTMsspSGLR5ak1h5F8M5xC0MwZExnREBOWbP48JahZL8O63QUY8Joofc+yNjI ZtheP8LN8uSHmqdl5CmItqI0t+MHZyCcNbPDLEP2RER+n9ki7FN1s42z7waOskyOQdHN 5lvwmp/y6BI+9PRcRhq3KWihJ8Qb4TYZIknAHPV5C4chamc5sTrQi+sASVKXzakJ5Kc6 /IviByFe5/EmOusLGNPCBAabVVUGsjt4RnDEfzLVJhSEqwR0+I18OsY81Iz40GUSC5Tb 1GCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=ULqGBj8S; 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 ds2-20020a170907724200b00787fe455e89si842056ejc.677.2022.10.26.15.46.57; Wed, 26 Oct 2022 15:47:21 -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=ULqGBj8S; 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 S233166AbiJZWoL (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbiJZWnk (ORCPT ); Wed, 26 Oct 2022 18:43:40 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4147313B513; Wed, 26 Oct 2022 15:43:22 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 877F34660; Thu, 27 Oct 2022 00:43:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824201; bh=mvQMiGrPqRBI4af3hBhxU3HI0eaRowKnINCh9+jrcSA=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=ULqGBj8SeLyN/SfR2/usj29XQun7NIgWv2xzq5RLvyiutKNOkyMD/UnZaEnL0YnNH qQ3BnWA27eG3L4xDwm9AwBaH1W8X07xzXMI3jaJGvDUSdNtdJX1xy8CFYUdc8wJINV 1gKXWmJN0mtPxyoHNx/kEZSi6gELDrH9a4jH/H/R7ss6Ek91Otj2XP51I2sFFHGlaT 0WjyMQvZlkGOQpSgNpy6v7vpIFzfsXGIBzpOqBJiolDXy3pnLyAXj05lk4at9SfW3j vFOw9TwO/0+W4e9hcjYRHFLlYX4ODmbEFY9g5wubbcIVAWfoWgJfiz+nv0hYD3wKkz dlW5AhxFvr1KkbhKP34VgiuDWsinsOUI2qP2+Ey/+uWr8H7M6iOc0J6snFDbou8HqT pYrOSm8s42ZpJTrBHuLdAR3ExbiYvw/zdAO2QSdcr2tqFWkucPCOdak4X+J4l0q5I4 QmeuHwUZPjDE6kW/JZB6YhA5UHnXLGDcpgdtvZPaxyTIjpel/nLwK6ezKqPucpjpdH DUI6d1ZEWMvo5SvKhJCVYPlILrK7M2DkMZzVXHYPFkgCc5ohcFcaoQH++/AQMjs/la N/qPsi4RzpVENHuoczo+o1twDdGyGQchsfaxzecrNdLyacGmYSQs+M182XEL28mQyB P4sSVpphFltQH/3cT+YxeYp4= Date: Thu, 27 Oct 2022 00:43:20 +0200 From: =?utf-8?b?0L3QsNCx?= 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 10/15] scsi: acorn: remove QUEUE_MAGIC_{FREE,USED} Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792105808457173?= X-GMAIL-MSGID: =?utf-8?q?1747792105808457173?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it Ref: 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 Wed Oct 26 22:43:27 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: 11454 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519466wru; Wed, 26 Oct 2022 15:45:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aHeDipgIIMAKomrOMeguCWPcgObYY/31As7/C87hR8vzJfiCipNkc5SPJyGRVy5QFXHuq X-Received: by 2002:a17:906:5dac:b0:78d:fc53:7db1 with SMTP id n12-20020a1709065dac00b0078dfc537db1mr38563647ejv.99.1666824336974; Wed, 26 Oct 2022 15:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824336; cv=none; d=google.com; s=arc-20160816; b=D6MC2ZPKOda6buddp6YVf7c+h9VzZIW01GKyU5v7m/X6QRB9JSIWg7B1gQfDRnv+Gk 6bVyklWNjQ7WROzou47on0Tj06suoEgSucE+niHv0x8yIKsGb3bzgMm10MATVh5SRCQC gMs6jgOH9kWjYYVeOWg1ksIBmk2xeJdlfWlCZMYTJFdU7yJ+5FDRYPuSs/8xpPi1Xc4r WAMzb6FPvZVWF8FoxzWleOAhoN7TQqbRrWdFMAmRhCMxnllfpn4Idbt67l9EjaNffyDd yOMcgBZduiHCO6AaXfUTYVLmyfmae/fc7StZKW/DYHx1qDNWV1OlopUcBJ6LXF2ciNNG s98A== 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=Hr0ZyoM7Iqc5fBAqCps2iE2vB5tXFv8joL4jTfgT670=; b=Z1AoH9MwO8nrZ6eYb0feudLMyqxjVnr8Ua9JI6LHvcKZuw1eaL8SU/VCPROB1a5x1E 5M2Xdbq05Wd02SM0DgR2+J4bbrnj0MzvMWLMyzAJ4e4cwGqSdhAwXUuxa4eb1cWWIerM kZi4aHtlhWkRSTiHuDyXdLWC4V2CNHCdZlUjsHmwFEJIZJeb17j9j7SAuGmCiuVKMelX 2HgxCBeGf4jZcBUxlr1z+sb9Xv+3nTco6V4I1mtYosFdx6n7Z2LFBFRCqiD2kzjqOQR4 Fco+S3q6vQQNRcqfI3GIj8qViNQpEFJCxpL/GXMjXKd2Ese8Oy7qYiLHIhsjNCBIz354 l99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=iFa7KApu; 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 s5-20020a17090699c500b0078d878d8fb7si7412551ejn.920.2022.10.26.15.45.12; Wed, 26 Oct 2022 15:45:36 -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=iFa7KApu; 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 S233801AbiJZWo0 (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbiJZWnt (ORCPT ); Wed, 26 Oct 2022 18:43:49 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C15713C3CD; Wed, 26 Oct 2022 15:43:29 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 988A04662; Thu, 27 Oct 2022 00:43:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824208; bh=VMjZ2qycutIQ9yRqoV9b0SXzFVlcw+xonVvFbZlQD2I=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=iFa7KApu5i1TGC3jVWTIoVSXk1qmn1VDuBugMMKXxqSXpHOv8537PrnKdBRnpUz6w okgPJg46grIXcB7/aD09LNLUIkC0cGrgt0cTz6CgbERNfbAXthNreBRlIiblSDoWDU adgkYl1Bq8iMO6ElK7ndLE3aoXY1TJMFKCcW5ZbGlFgD3gPPWL+O9dierkKkihbt/I eRNCKdD8wyW3zdBVCidfbDnbzM3b2eAoGgNGotB2hJfG46Z/kck8yUA1G8DShHGHmo KuNVhZt1WcMQijhMqAzQgxC+Fl8X3bAh8oYPzht/BIKuHvBrN3Qzjan+43HhD5OOmr izBSlL96cMNOdxogJD6pOHap8GEq29ZqdkkEom/X29u6DSwYrGWBnxvelPfoaQ7/F+ hrByGo0Gsl+CdTyBln2cuBO+8dNySiOKp225RlHOMesC7k9SnOgrGqMRSfdqXl9ldV eWKBv0X4GigJoTxOzFKMVLxZbYrF9PpP9/fPmlNRM6fPDUINrBk5EcaQBYM3snGIGK o9TJ76Y1ybODtseNzB4yDT/ASINhgzQ6omnKZ00c4o2ZQrma+9c05qf1PO3sPW/v+I cce9w52Yq6/QgC7qqJcpD06cIFD1AMXzJ9CYZ2ghRQt1Vny9NJgZKOs9y6Z7X91BXh BDvF0UpXHfoLPc9xoSo/CZ8o= Date: Thu, 27 Oct 2022 00:43:27 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Thomas Sailer , "David S. Miller" , Eric Dumazet , Jakub =?utf-8?b?S2ljacWEc2tp?= , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , "Jason A. Donenfeld" , Kees Cook , Marc Kleine-Budde , 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 11/15] hdlcdrv: remove HDLCDRV_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747791996376338969?= X-GMAIL-MSGID: =?utf-8?q?1747791996376338969?= 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 Ref: 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 Wed Oct 26 22:43:32 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: 11456 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519530wru; Wed, 26 Oct 2022 15:45:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/3TDy6fgFw3hoom90vC4xNx3teiB/mZc9U/sy/LyItHFD8ni1WTUVJPd1iS5mlV7qsjxr X-Received: by 2002:a17:907:a047:b0:7ac:ff72:977c with SMTP id gz7-20020a170907a04700b007acff72977cmr7836508ejc.260.1666824345821; Wed, 26 Oct 2022 15:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824345; cv=none; d=google.com; s=arc-20160816; b=eMlfGzKzhGN6mA8zuPLDU9pANFg9kyaSuPx6sYgS1SLPrzVL0ZFNCHltQEG7kXTdCs 9Y48Y9NnwBKI2sNgmIaoBYY/d9+P83R8OTKkHFXsEpDmik7JzYxjpG6Z8i7JUOKgF/su QoLMz6MpYdO4rQAfUgHt5sGXkEJGvRzRckEgyo5sPqYRqXEH2wJCCEQ1thC5sgJuAkt6 aau9Mr7Lg5anYeB6QlgT6eECgJnkCinV+LBSzijJWBFFy9kCZIYvazLJXJAIOEFDxlhI 0NEi7fxFN4mFDOQJeCUH8pH0G07EY3KDC53AT/94NxPmAhyePmK9GswU/xvR6ePJgkVy o2Gw== 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=WAxgj/LgUwA8lQLw1kF4//CB05HxM8AkI8fq+AXrhdA=; b=f2Yyc15TmXUXpzhEqXIPe4sEld69Ayie81beA51zXcI9kBSApPNRkmSvy6EZ2cymF2 vhDLCVNMYQKi26Oysm5n2zjTJ/rMhxmdmKgX4yBb59SNsun9402nTVmDK2HzoZaGHJUf AX8bRbbgoq6wFNIwiFZErRUIGfcLxy4ua8EqQCq7uw67S4ietKQAz4RrohbP0xWl4l89 QToesttIQpkyBOpA3tdOVvDJg1O6NLC4Thgpnlre5Nv2TQJADlekxN4AGnk9COwHL8td gHAA8fQj4kxAVBiry6uqwzTIeNLLqibgVt3dHm11iBfoMDZ7ua7cgXzlFp1GFYwxuC6i YkGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=uB03pUvQ; 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 d23-20020aa7d5d7000000b0045caa1628c6si5243651eds.216.2022.10.26.15.45.21; Wed, 26 Oct 2022 15:45:45 -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=uB03pUvQ; 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 S233921AbiJZWob (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233914AbiJZWnx (ORCPT ); Wed, 26 Oct 2022 18:43:53 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE2FC108266; Wed, 26 Oct 2022 15:43:33 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 2979445F2; Thu, 27 Oct 2022 00:43:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824213; bh=peSt6Ngd9dQwG3mJMnSEDxxpVnYEqXKHKBMQf6O6+NA=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=uB03pUvQoQ3l89bCq8VZ6g43zIA1TozMbKO/u0r3royUEci2wPDbNtn3vTC0iMI21 iCndnMA8JtnZzauiY126qxn+NyIZMQxeY4RS+MHwrMqH1GWWfc1L0una8VSjMpB+Mh DJl3ngRAkp8DnYCtewsTHQtsTvpAZYMXDsXFUz+KWBFCoIbw8pBlHoe8qhJEahBuIc faLTs5P/1pBg65cnzyf47L/YX8ahM5qhSyhl2RqypEcbaoxBkaqqe1Y637gaF1FNh4 U/+I1ONvpF90+PTUYqnO8fWzLrHQ3KvKWs+QeLsSuaD90nS7XKacNqW2NZJFlNtfeu j5022/PL6pWIEeP+7XJN//kPECVciEkq9S6vQj2+1kwFGi960+vHz6IHYMunA9oVGf MXRKSnF6tTbimwHjNzz2fITmP8ZH1xUMduOzTBFlnHyfw+H6TT0Xz51ZWCfYer6rAe YX7KBMEtg9HLCePThFRZVxh9dVpDRc2XulO8gD7Mxj15eZNe/YDl4DJe185miwjEXb ps4G4AF9wGvcLopKivR+DGSq6O0cTkpUU2Cmche1a+CnPvQW/TgAUc9LDy6CuJMkVZ fO0SgvuNtKAuLm73p4MWZ0Wv5e1j0aXG/AY1eqPLHK6VweBP9P7ofIaZ4m8ErrMilC yrkEFPpOG5gssZUyUeXHZPsY= Date: Thu, 27 Oct 2022 00:43:32 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , "David S. Miller" , Eric Dumazet , Jakub =?utf-8?b?S2ljacWEc2tp?= , Paolo Abeni , Greg Kroah-Hartman , Jiri Slaby , Marc Kleine-Budde , Oliver Hartkopp , Sebastian Andrzej Siewior , Duoming Zhou , Huang Pei , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC Message-ID: References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792005518331477?= X-GMAIL-MSGID: =?utf-8?q?1747792005518331477?= 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 Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska Reviewed-by: Oliver Hartkopp --- 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 Wed Oct 26 22:43:36 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: 11457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519663wru; Wed, 26 Oct 2022 15:46:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QnbztfdgSnwi8Ei6VttNkSc2Z9AotYWDQUtV0X5NoqVMnaFo7FnQ5gCTR1dJQMgXYwJFc X-Received: by 2002:a17:907:3d9e:b0:791:8933:f9fc with SMTP id he30-20020a1709073d9e00b007918933f9fcmr40224767ejc.111.1666824372266; Wed, 26 Oct 2022 15:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824372; cv=none; d=google.com; s=arc-20160816; b=VpPEAHZ3Y5Vk6ZleAqLjOhzGjeeMFtayhRihEKgOoDwc/mo1JB6eTEk+l3bU8hy7mB pl442NrbGdaSep5E15tE0rV/U5+qQ4P56g8kBHzVdGTFSsunQxXwYiltJHdSjItohTyB Slemb5QqGUvQ1KfmYCPI/qyYyglqF2uSnw2Z2HbOKwzoQuCNtJVeHbyghCf0Wu+u8MMj rcxFopw6/fbuqSatqMlz46AlEeELcofA/tObFOm3vi3YoemsSoI4OQcT5gXbztAKV0gI l+xeSGHksKdbXaIXnhht7k/PJQKVnZmDl5u0hufT5AVBSJmxkz80WBcs+rP8lTNBiKSC aSfw== 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=ikHZtfa91RDXjgRgiwdf2WejDcuG511v/2LpcxDAjls=; b=UxOkYRb2fLOCbCKdzeg3r2pVbvHYeUVKq2Nsvg/BmpLLKNgW0vQAFhChVqVsq89Rg5 ApFs8qjOHaM9VTFNeT+Cbk7VPSnZFjpkiUvJ1T1u6WWwy9ZMXA461SJ1OA2X38hzDM7A dmSqYX7Ug8vr1HDX+3lom+bHFC4mFk36atymvjTeQ8bLBK1AzNzMC7BP4z4WUSP+Z+/A x4dJ2xpFsQfgYs4i3pmE2WGysx5f+GpFHnMPrrs5xnqS2B0KYS/kDKYtKRoQnzNXUrvo Gk8do4txh7gukQJQ3IOE5wdMdSJEH34NGIt9fu1yLG4xedN5PUlLbU4Y2T/3JuVUZB0K SQXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=XTAoIpUx; 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 k27-20020a17090627db00b007ab349af9f9si5896085ejc.158.2022.10.26.15.45.48; Wed, 26 Oct 2022 15:46:12 -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=XTAoIpUx; 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 S233607AbiJZWof (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233924AbiJZWny (ORCPT ); Wed, 26 Oct 2022 18:43:54 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88003F53E2; Wed, 26 Oct 2022 15:43:38 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id D4AD54B1C; Thu, 27 Oct 2022 00:43:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824217; bh=e8NfwyZk0kVFMKWCFjNMasZpKgncxX76xLaXCy/oYY0=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=XTAoIpUxPq5YEl9T/pU3mjCQ6HPWUXpwp5jl5pro9rDRJWH1P+ceKNvhpSjxhCKOo 10SzcEgbzTHbjCdtJv5LxLjihtg0fqgVgrTF3M9wP4qtvakcGnotbC7VV1GSBMZH/4 sIOFQG/qRjB8W9xHBwz+IqlzSqgmIWhBocFi+/7xzxgM7rpm2CUOP1PvXlXbgjbgTe l+xpaqlEnC1Es8qOfpGz4uExohagoay9E+qnYnTfjgssB8f/LZ8JjBVeNSv7qdHpnd akaZeucxguwGb+sfDqS64ZhZa8sML2YoJbDxgLgPqnkRUbvOGkIPRAgO2fN0J1iGmz cGzowGZiBw5zrFo09Ia9AXeps2gWYpg+X+WyQiaN5kwKLIyGdc0QuB9TkkHoVd2aD/ ofNDn9U+WtLCdHNTzbySiK1/fht88lQq9sQtvar945utt+JDVx2+0Z40qWl2qB+J6y bATQGq3b8bHzBdnTabSxmtOEJsTdxxhOwHhfxP/QkcsccWd7XF19VOEUMeppOFNT8q Hg2Q0zDjpiTLYDA1YiAt/svm4RNC49C9SHpSzUE375FJ4jX7Y2G7HAMGp2S/DmNNFM DKURUpaTVa/GW6hIPGD19bClWxcvJBFocRVrM6FQfnWBW1xzR5of+5E8ZkPlv7OUJp IhJjDjXweTWi5frvTdSqs/K0= Date: Thu, 27 Oct 2022 00:43:36 +0200 From: =?utf-8?b?0L3QsNCx?= 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 13/15] fcntl: remove FASYNC_MAGIC Message-ID: <4729b484174431a57b6bca139fe659f0e27b7e1a.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792033462108221?= X-GMAIL-MSGID: =?utf-8?q?1747792033462108221?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it Ref: 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 Wed Oct 26 22:43:42 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: 11458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519683wru; Wed, 26 Oct 2022 15:46:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6oHNG9F4P6v3afLFsTfSHA8l4aG2SfpZw6YmIOOagGcNYrIy2NpVZVbJP8ZO/oIxu9iGmK X-Received: by 2002:a05:6402:2552:b0:45d:ecf:b23 with SMTP id l18-20020a056402255200b0045d0ecf0b23mr43345529edb.255.1666824376276; Wed, 26 Oct 2022 15:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824376; cv=none; d=google.com; s=arc-20160816; b=EaAlfNiiw6WNzjTJe8Mphu1/qCDhzgfl/f7v2mphGpoR2bMjhhlmTMIjyZjhu8BVsi TBrBOcF8S+C/PkA3Kt2LkmKGNgAaRrIVYuJXBJEc08hi/B+a1u508SWqW0BrM4AH696I Fk38fFFE5gILpOtgvvjN1AXNuVTuCqPMvGrTXZP98nO3p9gl13g4Bc2XI/6irfvs3ZdG eaSLLsmzvbrcMDB8sBumAYgBNKzLs2SymCNvplhxU8PSlfgDTCFUtaB13kzjkEe5TR1u FajgNoJDD2XVuY1ysYh8Uz/zL78aqs6UaVQ43bZvEI+PXSqM6UlC1D5l9fHB6mqMvGcL twUw== 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=6ShvUmLjs5NKvpnvCrK0RpLg16Jefaki7/msWJwefEg=; b=H5MzC5/+wx5cA0jXS9w5eOLljhJ/fqfPr6CsMdxmqp/J8QPnAOnFp7IQB8DoYZSMtD 0TrOZoBFumpF/ZrgCAnD/kiMSo4qLPBTproHUaHGUp4w75x+2pk/h9+V7nN5A9DfMEs8 xkttsqg3oj/1pBwEdOcwlWYIfyWyNHfNWm01bHM32WCnCPou9aCvr5GMMYbsYUoSGYqZ DV0dm3mtxF3G1z7qOl8KFWaMgapf9B2injDtCkK0c3gg6iOlgHlyEXsXmdPeFPpKKUQY 3C/aZ9Er9CBCW2Uv+mnzwxSI8r8PNiM6DkgumR+WpDVxidS9NaKD027kJJ/Vu1UIqbat EqkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=kYdJqh4Y; 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 kx3-20020a170907774300b0078b41dcf4b8si6135393ejc.479.2022.10.26.15.45.52; Wed, 26 Oct 2022 15:46:16 -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=kYdJqh4Y; 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 S233960AbiJZWom (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233479AbiJZWnz (ORCPT ); Wed, 26 Oct 2022 18:43:55 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E35B31382C4; Wed, 26 Oct 2022 15:43:43 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 3E72645F4; Thu, 27 Oct 2022 00:43:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824223; bh=cWJrh+4WCcyvm/bC7QDo7SLpdliy33Tc64LT+Dh/mqI=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=kYdJqh4YcpcPbQ6fdbHeflPyOx4/DgP2plZfzVH+WFzCMTkcgQEUxmFjnTDD0nuVA RvBWnX1Jefcy6oDHMM15a2rKgf/P5PYAUeXgi/5nUa/wCo++wYy3afds0uu6V9nWLZ m7K3PCCJFILjnsnqEFyG2prno/5bYFZocOoAb6muvw+TmdPJaRmA6dF+hJmmvh+rHX 0ERAV6G+r5qDeBqHrQIcvRRoR/zz+EV+o+1QHSD2S4Tf/Ye1bR7yhdsgbkv61cNi7z RaDf3MJA4GfJIq9KgQ4mqg7jYX3+Yi+NpoBx5EywRoFIpG1sg41sVN/FotYZIy0wpt LmvfqKtU+0CXHkDDPtKHPxUhQMg9bCK3KG9JtxNQ2peYntO4tKcfC7RE9rboUzCUag g6jsJsZfACuNHZMn28Li1jPMc/i3w+MQ2AM9wK5GBRq8GFeeJiQufwE6vBWPkyVdp/ G1X/O+2oBgu+BSgCismFWHlroKUez5dyYuu8wM67/lOAOy4uf3hWwqRzYEfHqCvjo5 K/aZvZFj7O7uwylTdATv9AEGwVgozQgfnzi1wAv7KEY31i1CWnCzNsPjiv+xYkQFVw I4gHqRm+o97zz7lHl1np9/0tG+wTImqghyetflA1X/tuMB8up4N/cMl+wLF/J3T0RR +Qqe8C6cSDEr9JBnvrRc05TE= Date: Thu, 27 Oct 2022 00:43:42 +0200 From: =?utf-8?b?0L3QsNCx?= 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 14/15] scsi: ncr53c8xx: replace CCB_MAGIC with bool busy Message-ID: <182906437bbf7597968cc68e0babe6f7ff772f79.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792037032358179?= X-GMAIL-MSGID: =?utf-8?q?1747792037032358179?= The only non-boolean check might as well be, since it just early-exits instead of 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 Ref: 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 Wed Oct 26 22:43:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 11465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp520772wru; Wed, 26 Oct 2022 15:49:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61X9byM+sbCdxHjdC41yj7kXVWb3Ow9x90tjwvdmcL6T3JgGhYr+yjOD7GL74vkpGKGVzw X-Received: by 2002:a17:906:5d04:b0:722:f46c:b891 with SMTP id g4-20020a1709065d0400b00722f46cb891mr39356173ejt.4.1666824579618; Wed, 26 Oct 2022 15:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824579; cv=none; d=google.com; s=arc-20160816; b=R/WNuiDm/WVUgR2K8BzoNef9pxRN1M8qzviX452wpkQjX+rH+J8zMjzkmF6UN0evPB oaYa9QhTRr6/SUu3efdeZfXnU5ekLOBWgXaLGSvtj6WZ3SGKiscRLuclQgkSXFvNexi7 eeGu76HTtb5lJfB5c19ahG/xjLcJNpvIYFBl5yxu7VdbXb2hMpuGSC45JJOSGzW8+BdW P3dSBm5WzDMOkW3DAo0gEj/MsCNUZoAgvhm2FEtvyEEX6TC75iGlNZLssR3uGSu88vkg SppZBWSznVws8Mjhxq2k+Vs7oI6/Rv1Jvqr2utc23iBXIETAQNC0/LTxKn3JKTBl3t1W cfoA== 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=WIUxEYTuxU0XUcDUkTkuPdp+U1AXicWYDawuH2PBC5M=; b=hNMpFKY2ie22p/rbTK5dO6okcGTdE5hlbOTwkN5A5TELLDZJAVhxmpZGZHay3B983H qLIhYA1zLMRHLLODEieoZmhQL/utHRAJ4Viicsy+Aiw5wzUGULDVwrsO0T+vr+IdvjTY jcVUkAD/mnlSPcxPKFNjwb3Npxdubzuwyz5pI1GaWhvcaWtUp2F4Cl/YXvBAwaEXr6EH 3/D0n42vpzVE12smKL4SbhV7vcAvpUGge6Oxu7o3Mrkvmi4VOPG2nzyov5z1knYLCizH qUMOP0eEpHAmeShi7+vLeKf/j9Ve0gf45tudHCK6HssPMpTnMkIRtze9LSuOzWTAubTR agog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=F1q8fx42; 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 dt4-20020a170907728400b0079196245be8si7609628ejc.657.2022.10.26.15.49.15; Wed, 26 Oct 2022 15:49:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=F1q8fx42; 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 S233975AbiJZWp0 (ORCPT + 99 others); Wed, 26 Oct 2022 18:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233835AbiJZWoI (ORCPT ); Wed, 26 Oct 2022 18:44:08 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94E17137297; Wed, 26 Oct 2022 15:43:49 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id E13B645F6; Thu, 27 Oct 2022 00:43:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824228; bh=13bJ3PGATBe6m6ipAKsYnwQ+WdgCATcYlf6DlHJtLe0=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=F1q8fx42/AZmbNHtLuFj/dM5113GxOWGW5pwkcODKYo2qaQO7gSQMR/M/DX4beNbr X0aHe5+oEsuiEsDgfniB341hoBb6jyXW5D708FGtHxBIERKIIRFM1YuNvBl1+W1RJM OBPCVq0L3g7HNykUTgotrb1VgUMXN5tB/WzWbfx9XhybzJxr7+PX14w1QSet8PfTeS 4CB8GtwZ15gZMVpQvgZuriPZYCF3176PETuL/cCvDNsqkqAim5I8uSke1+xigj2TTm KUy1c0A0TYT8UdXc/gmzwnMKa2Ub5o/qa6We43t43qRegD+K8bUXlpJcYEKOLYJ0nd nZFL/G5QNNmB8cuhF8ijHJQKpx3zWObRDKU0KSEzyV6qU3mQKyCjavVSpODyzo/n7z tocntLoA3HVEECFAyd0tZ17RfZaTimCNR2rSIeEklDtOaZfzikVOvq0E4t9AnX8+3h eY2tbWZ0952k4XZv5E6EuNRSArQljdORXL2rKYX8vgl4r2ujl1xvOUu+IpivR7TiQ8 esNyExYD6ZEXnJV3vF8LzOxzC3oyJeav9WB38/sa0yp1gGKVQixAzoqcZUE/d4dsXP u6LsPqNl2LToe/v9OUlKE7jfeu73E58qh9RCLyyArNs3H+E8hrNoaCyuJlcm0Qi0QR 3CYkiLn/PS2T80cqDgOcl7Uc= Date: Thu, 27 Oct 2022 00:43:47 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Steven Rostedt , Kees Cook , Stefano Zacchiroli , Thorsten Leemhuis , 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 15/15] Documentation: bury magic-number, now devoid of content Message-ID: <83bd024a7f81492be259a531c407cb017186d745.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792250752313946?= X-GMAIL-MSGID: =?utf-8?q?1747792250752313946?= The list is now empty, and we've largely moved away from this approach, and we have better debugging instrumentation nowadays 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 - -===================== ================ ======================== ========================================== -魔術數名 數字 結構 文件 -===================== ================ ======================== ========================================== -===================== ================ ======================== ==========================================