From patchwork Tue Nov 1 23:05:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3262095wru; Tue, 1 Nov 2022 16:07:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56/6J2avOuvhg9ZRo8M5to10Pou6/J6BLkCMjuFZZUiNjvSFanmOXjxqacGA/reogToyCq X-Received: by 2002:a17:902:64c1:b0:186:827e:a0da with SMTP id y1-20020a17090264c100b00186827ea0damr22104683pli.94.1667344049881; Tue, 01 Nov 2022 16:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667344049; cv=none; d=google.com; s=arc-20160816; b=aykvI4YusnHB3ABX//8T3z6h84bv1nzcKoIDcOZzfetdZ1PhD5g7a9p7VC23DuMQT9 Ck/Q2LY0dJ2HeJ11pEF6+hWDcB2psa5al6cEi523AhrmBvGus/yP4dXfohDBzKNsMWUz FTVn4TA1sLTXr3zfWX5Ygzc4llEttoozm+esROvQCRinLQA5P93EqmLJxLM6da/Lq7bj sDpQ6TJl+WlwlA1OsorLxdY4EelcxVMb66nE4l15z2H0gE2nYTYWSUIYzMxGNaH7fXU0 6GM3ax3XZLk7QWErdDXwBgyLBrQQUUKR5iMn3hd46pAlqz+pwOrSQOFonsjpG296B2JR WpdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=NIlbeP92KjCMNZtX7jLUD/AGU+UHt6tEM6nbN4VgTOM=; b=kPuVuThRmHx9ke3mpXBvhbJT8fQOo3y1hsgUZF5n2GApEGAppTmpVeZq/RlE6J0xiV f+hlAafllMO9kGH06MuJI6cyUIoqXx8rKBZ4tlIxlCnjwddaR4NwLYmMab6VW/AKLNnn cVIB4iICLnC8DAvwjF02X3J2ITk4CIMDYctfu29vs//8c8tSumSK02w2K4M3XBgEyG6w Uk0x5s945DLnU3uJG0x2DGYldbjMC+qE94/YMkdx706e8eSLCZ+a0H/wfKy+4AcweUDs 01DSe74wUhEPCvQozuxaOiRcY6N5IUDjOtwG2TVZpn2BO43CkGg2GQ8b1l+8ruAMJxN+ TVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=LbFzW3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qe17-20020a17090b4f9100b0020a7e0138d2si296567pjb.50.2022.11.01.16.07.17; Tue, 01 Nov 2022 16:07:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=LbFzW3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbiKAXGN (ORCPT + 99 others); Tue, 1 Nov 2022 19:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbiKAXFn (ORCPT ); Tue, 1 Nov 2022 19:05:43 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A6D2B201B4; Tue, 1 Nov 2022 16:05:41 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id EFFC14EF2; Wed, 2 Nov 2022 00:05:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1667343941; bh=lR8M22hMDuWVHgEQasSfSc+6twHse9gvApvhgLw5hgk=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=LbFzW3tI/aQnkUbAh0fMtVsgclhaPJJyU9odpcUVRzyodlRf3Am5SAzJoBM/whsda 4UpP9Goexk+DmUfs/zsVXdcuaOTCvqRPPwOMJ+H2fRmNBT/G/whLJQnmdwNLx9/oYU /uF57j99pwX1PKiHqzCZQdk4OMdWzrzi6iLEP91MMETk8wdmrtmPB22XYnUP8GFMXT Zp9+LQcIZyETucailYMzJlMni7scUIz3mB+yPevsBoB7EFENNpSeWicJJP83OXP0Cb Zk9MMr2SIXB8T7WH6AqK0bh95TF5/YcgV884yvkmIC4leJsWuUrdH5COE+rdmH/0+R hnUsdlIcDyV08TKShotui7i2cESKZNNqDnFAaQ7zXzIZwD3ZeX+uOE8+HLVIl39NpB 3r4p8lLoR9/+Vhp0ycdWskDG/tCxAKw3FuNQlvNft86QXQnD2dY7O4j39Ir2Pfuw6K k7KtdMBXJZIpIFCLQVbX8ejXN8CU6ZtCxvL2ZXlwLw9U+s09PxBsfwwceFbIjokHZ1 nUig8mCUMb8CC64+BpWlO2E3gli9+SAxjSxaBMj7EjWgj2JN3LDl+cmmjNzaKbVFFX MHIJwQC/e+xjSF/uAQ1vRjly9UWORGu5pgYZshuMwY7kbp2/09OkzxGa8QKvdrTy4K 78Qq3jEGSmAGKjbDG82AM3fM= Date: Wed, 2 Nov 2022 00:05:39 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jiri Kosina , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Greg Kroah-Hartman , Jiri Slaby , Kees Cook , Josh Poimboeuf , Peter Zijlstra , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net Subject: [PATCH v2 09/15] x86/APM: remove APM_BIOS_MAGIC Message-ID: <16e8d8d655122eecca13dea536f637923b7dfc88.1667330271.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748336954623414328?= X-GMAIL-MSGID: =?utf-8?q?1748336954623414328?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it. Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 1 - .../translations/it_IT/process/magic-number.rst | 1 - .../translations/zh_CN/process/magic-number.rst | 1 - .../translations/zh_TW/process/magic-number.rst | 1 - arch/x86/kernel/apm_32.c | 9 +-------- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index d8ffbc21872e..77a96a79c7e8 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,7 +68,6 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 0e59704aa617..ef509265a3df 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,7 +74,6 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 17a73661ef17..6437c408dd67 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,7 +57,6 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 9d44d49b93bf..453cc205e6c3 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,7 +60,6 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c`` FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h`` diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 60e330cdbd17..f3dd21dc56b7 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -330,7 +330,6 @@ extern int (*console_blank_hook)(int); * The per-file APM data */ struct apm_user { - int magic; struct apm_user *next; unsigned int suser: 1; unsigned int writer: 1; @@ -346,11 +345,6 @@ struct apm_user { apm_event_t events[APM_MAX_EVENTS]; }; -/* - * The magic number in apm_user - */ -#define APM_BIOS_MAGIC 0x4101 - /* * idle percentage above which bios idle calls are done */ @@ -1459,7 +1453,7 @@ static void apm_mainloop(void) static int check_apm_user(struct apm_user *as, const char *func) { - if (as == NULL || as->magic != APM_BIOS_MAGIC) { + if (as == NULL) { pr_err("%s passed bad filp\n", func); return 1; } @@ -1616,7 +1610,6 @@ static int do_open(struct inode *inode, struct file *filp) if (as == NULL) return -ENOMEM; - as->magic = APM_BIOS_MAGIC; as->event_tail = as->event_head = 0; as->suspends_pending = as->standbys_pending = 0; as->suspends_read = as->standbys_read = 0;