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;