Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3578553pxb; Mon, 21 Feb 2022 00:53:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBD/hhC5yQjyMxS8gjHqmRjWsRJ4OHcGjIt9bKjiN4RePG2mN6fowBR+ud+fxXmVjdKS76 X-Received: by 2002:a17:906:f90:b0:6ce:8c39:3881 with SMTP id q16-20020a1709060f9000b006ce8c393881mr15214300ejj.302.1645433603157; Mon, 21 Feb 2022 00:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645433603; cv=none; d=google.com; s=arc-20160816; b=sIkvyOCwWFHY6VRJXDVLdzTxk3x5az1O6ZR6O9hghXwiP4IH1Vpap0KST6rl+HRPa3 xLEJLXYRMyRjFPY0vr9mOmHIRMejLfbnnowUD+MnJwtwHFxQYn9n6Jhkib1P2UUQTgAu wMNST6DZSORP0c5nzbA255HPdBhRpptxjnNk3ufi81fQeX20PfoqnA2YCIL7itRKx2E7 z5T6/EOKL5U2C0TcqFkhaAwcfqmVY6N1+0bS/SGZ6z0Sw7q2aFEQt6DLNPQ2Ac4RZ8/S v8UEIbXQ0g7mmeC8hp7UbLUrdToD16l2JIj05duTTPj937IY6h7eJBWghRW/8lXipERu EDlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=CKrh1v2AkNy3iqwrIciKqgBLw0cSctlNbyRAlKOkijo=; b=BL+xhKUqpogzfxrV9tEWQRWbNwVgOBcsHItsRYCtt+oApnf1khw4UR8EK2p+1JH/8o IBOKmfxUeEO8qGGv8EJwmjK69/4y/2eTZWvHLgr1YJGmWK07Xr6GpLfi0N4rLgcKTk+s JUkRRE5RQ+iq8l670kr0xaIAxLVuFNFf0i20ByNG6XAPchpZxmZrYL6HAktKCgntPvRT 59SpphXcmXkasKETG0aSgdOl7JmiYZ/sDaOjS6jZpicITkGmR9bMByMEO7kLvAdN0kUN 4LkUmLNZdVA8LVF1mSYU78XsdAl1Oy3O8GjBYIVOi9No9mqGEBuEyfhzmBW74QTmOjRM pVWA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7si8697171edr.514.2022.02.21.00.53.00; Mon, 21 Feb 2022 00:53:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239954AbiBTGBu (ORCPT + 99 others); Sun, 20 Feb 2022 01:01:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239384AbiBTGBp (ORCPT ); Sun, 20 Feb 2022 01:01:45 -0500 Received: from smtpproxy21.qq.com (smtpbg701.qq.com [203.205.195.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF26554AB for ; Sat, 19 Feb 2022 22:01:22 -0800 (PST) X-QQ-mid: bizesmtp82t1645336866t5uc6nr6 Received: from localhost.localdomain (unknown [180.102.102.45]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 20 Feb 2022 14:00:59 +0800 (CST) X-QQ-SSF: 01400000002000B0F000B00A0000000 X-QQ-FEAT: X+oTZzR2YPgLP2/i7yIbDL5tLF5aCxs9hfHc/ADu78N1w7TWGQCEuREZ3QnOd lvWEQkz9Bvyp1My9hZTgnhuRnXRx+DJjk019R6yAXzIQ/jJhHBT2xqqRgZ5PlPIH1MUBuq3 5Zq1dwnXK4HlJEIFkVskAK8MyvL5d8S0q6sFrxaNSg536XImV5mOT1G7LlgTlaxV7Oj2uyB aT5T7HGmEXVyT3aLa8v/wbITINlJTO+S00KC2phEyV3EDIQAr7OCRy3Qs8L812G1PdxSwJr EV0Mf1fRrU4jVBb2qFG9DrAE7U168SZHN1Z/kJGbY3I+9mtwWo66tpnBWpk9IVPUCBio03f peI8bQZ4T3rVWjd42GDStccyEy5XKxksLjKw39v X-QQ-GoodBg: 2 From: tangmeng To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, nizhen@uniontech.com, zhanglianjie@uniontech.com, nixiaoming@huawei.com, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, tangmeng Subject: [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file Date: Sun, 20 Feb 2022 14:00:53 +0800 Message-Id: <20220220060053.13647-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the acpi_video_flags sysctl to its own file, arch/x86/kernel/acpi/sleep.c. Signed-off-by: tangmeng --- arch/x86/kernel/acpi/sleep.c | 21 ++++++++++++++++++++- include/linux/acpi.h | 1 - kernel/sysctl.c | 9 --------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 1e97f944b47d..256f3c065605 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c @@ -20,7 +20,26 @@ #include "../../realmode/rm/wakeup.h" #include "sleep.h" -unsigned long acpi_realmode_flags; +static unsigned long acpi_realmode_flags; +#ifdef CONFIG_SYSCTL +static struct ctl_table kern_acpi_table[] = { + { + .procname = "acpi_video_flags", + .data = &acpi_realmode_flags, + .maxlen = sizeof(unsigned long), + .mode = 0644, + .proc_handler = proc_doulongvec_minmax, + }, + { } +}; + +static __init int kernel_acpi_sysctls_init(void) +{ + register_sysctl_init("kernel", kern_acpi_table); + return 0; +} +late_initcall(kernel_acpi_sysctls_init); +#endif /* CONFIG_SYSCTL */ #if defined(CONFIG_SMP) && defined(CONFIG_64BIT) static char temp_stack[4096]; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6274758648e3..4f1d9cf579f5 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -349,7 +349,6 @@ static inline bool acpi_sci_irq_valid(void) } extern int sbf_port; -extern unsigned long acpi_realmode_flags; int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); diff --git a/kernel/sysctl.c b/kernel/sysctl.c index e6d99bbf9a9d..62499e3207aa 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1973,15 +1973,6 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dointvec, }, #endif -#if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) - { - .procname = "acpi_video_flags", - .data = &acpi_realmode_flags, - .maxlen = sizeof (unsigned long), - .mode = 0644, - .proc_handler = proc_doulongvec_minmax, - }, -#endif #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN { .procname = "ignore-unaligned-usertrap", -- 2.20.1