Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp275695rwn; Thu, 8 Sep 2022 01:07:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR78Zf+DMihYtRMEfqLADKFhAe5E03i+AQvwAtkTjoMDwTPDWWv/26U06wzEZXRpbqBm/N6J X-Received: by 2002:a05:6402:ea1:b0:443:d90a:5d31 with SMTP id h33-20020a0564020ea100b00443d90a5d31mr6063717eda.121.1662624454851; Thu, 08 Sep 2022 01:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662624454; cv=none; d=google.com; s=arc-20160816; b=l6Cg2JiVBl7lqtafSImTv0AXBC9dmh/iCqh4DNb8MRf0YwJVpyKqDZ9r5jLhxKxgaH XPCNpK9ryI2X9QJAzgcMGmmkGNUSPhktwczMRFitd5LneGMkC1xtH8z5AYzQx228bMZK Vd72MIyMF8iYSaz8yNMYY8agGVJ8iKMezAV3cAKcQa33Ti1dY3uv0CYo5vC5hTMeIDwL bmFnyheX7NqsJkDeeJZMMQc+jHNI1nEIkwedQHMZRjxtmWcMew/0JCUjK8bffsz8Yr5z UjhxqzhH6KF/l54hQ9yNkEK2e5PouPSuY14eucjVRPnRr8HFxx9G0MI8jDbzusCGA8kW g7Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IhoCV+AXSbuVc+G/ee6nLoE33Uixh4a4JmRh89WhMfI=; b=fgihU6TS5O/Smvn98uPoLpHkJ+e5X9a65j180LnCNx29ZaBQrnAom9CTnvJko+Ac1i bBbdRGndgG3kkhPz2067C6wsUq2k/0enyglj4HjmD/OR0kOjDUpLCMy93pXx8vQq8eTS +QQ7WM8HCAMQfUPjKhyhjFqsi2yUbxlt327VWWYF8HWqoeGUTTQKFYh48HD/sFbkoWDQ x0HRlWIGiF7nmcIEyrsmzlYrLMVyM8XoC4cHx1ieAM51t2g7jxtdn3DBGsEoch7ao38D GFXh3kqUr3NRPS5SXdQL1Z15qcXeylenpcTx/IKnH+vlWY4+OsCGadgF3Slj0abkD7J1 zRiA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a17090607d000b0073d635877ffsi1492203ejc.478.2022.09.08.01.07.08; Thu, 08 Sep 2022 01:07:34 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiIHHzt (ORCPT + 99 others); Thu, 8 Sep 2022 03:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbiIHHzn (ORCPT ); Thu, 8 Sep 2022 03:55:43 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76AD060506; Thu, 8 Sep 2022 00:55:41 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MNWY21X2jz14QQt; Thu, 8 Sep 2022 15:51:50 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 15:55:39 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 15:55:39 +0800 From: Liu Shixin To: Luis Chamberlain , Kees Cook , Iurii Zaikin CC: , , "Liu Shixin" Subject: [PATCH v2 1/2] kernel/sysctl.c: move sysctl_vals and sysctl_long_vals to sysctl.c Date: Thu, 8 Sep 2022 16:29:46 +0800 Message-ID: <20220908082947.2842179-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908082947.2842179-1-liushixin2@huawei.com> References: <20220908082947.2842179-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 sysctl_vals and sysctl_long_vals are declared even if sysctl is disabled. Move its definition to sysctl.c to make sure their integrity in any case. Signed-off-by: Liu Shixin --- fs/proc/proc_sysctl.c | 7 ------- kernel/sysctl.c | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 021e83fe831f..42a7cdbe514b 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -28,13 +28,6 @@ static const struct inode_operations proc_sys_inode_operations; static const struct file_operations proc_sys_dir_file_operations; static const struct inode_operations proc_sys_dir_operations; -/* shared constants to be used in various sysctls */ -const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; -EXPORT_SYMBOL(sysctl_vals); - -const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX }; -EXPORT_SYMBOL_GPL(sysctl_long_vals); - /* Support for permanently empty directories */ struct ctl_table sysctl_mount_point[] = { diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f10a610aa834..8ccd8d755c5f 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -82,9 +82,16 @@ #include #endif +/* shared constants to be used in various sysctls */ +const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; +EXPORT_SYMBOL(sysctl_vals); + +const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX }; +EXPORT_SYMBOL_GPL(sysctl_long_vals); + #if defined(CONFIG_SYSCTL) -/* Constants used for minimum and maximum */ +/* Constants used for minimum and maximum */ #ifdef CONFIG_PERF_EVENTS static const int six_hundred_forty_kb = 640 * 1024; -- 2.25.1