From patchwork Sat Jan 22 06:11:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12720486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD628C433F5 for ; Sat, 22 Jan 2022 06:11:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 728DC6B0092; Sat, 22 Jan 2022 01:11:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D7C16B0093; Sat, 22 Jan 2022 01:11:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57A226B0096; Sat, 22 Jan 2022 01:11:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 4630E6B0092 for ; Sat, 22 Jan 2022 01:11:14 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0DF6E95AF4 for ; Sat, 22 Jan 2022 06:11:14 +0000 (UTC) X-FDA: 79056900468.06.A7A9CE3 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 266834000E; Sat, 22 Jan 2022 06:11:12 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67B6960ED9; Sat, 22 Jan 2022 06:11:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60BFFC004E1; Sat, 22 Jan 2022 06:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642831871; bh=47QHIV8PAif4CKUACvrjOs9DaUjDHRyOe0K1tHqVpqw=; h=Date:From:To:Subject:In-Reply-To:From; b=ai8Xs2YfA8rJ5aPerMyIj0gxyP4C2ScN30bBS4+ax4XEQzwFmCcTMfdAadV0ZpdO5 z5Qg6DohmXyj8021TbKcoR8pv9Cfy1S6K6TbZw4/CNsxXoiAPmNqyh1mvtxM9KbFiA A10BDFB6mcC8h7X4U0NLGbIKopK8f74XVGTnV2KY= Date: Fri, 21 Jan 2022 22:11:09 -0800 From: Andrew Morton To: airlied@linux.ie, akpm@linux-foundation.org, amir73il@gmail.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bcrl@kvack.org, benh@kernel.crashing.org, clemens@ladisch.de, crope@iki.fi, dgilbert@interlog.com, ebiederm@xmission.com, gregkh@linuxfoundation.org, jack@suse.cz, jani.nikula@intel.com, jani.nikula@linux.intel.com, jejb@linux.ibm.com, jlbec@evilplan.org, john.ogness@linutronix.de, joonas.lahtinen@linux.intel.com, joseph.qi@linux.alibaba.com, julia.lawall@inria.fr, keescook@chromium.org, kernel@tuxforce.de, linux-mm@kvack.org, mark@fasheh.com, martin.petersen@oracle.com, mcgrof@kernel.org, mm-commits@vger.kernel.org, nixiaoming@huawei.com, penguin-kernel@I-love.SAKURA.ne.jp, peterz@infradead.org, phil@philpotter.co.uk, pjt@google.com, pmladek@suse.com, rafael@kernel.org, rodrigo.vivi@intel.com, rostedt@goodmis.org, senozhatsky@chromium.org, sre@kernel.org, steve@sk2.org, surenb@google.com, torvalds@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, wangqing@vivo.com, yzaikin@google.com Subject: [patch 06/69] sysctl: make ngroups_max const Message-ID: <20220122061109.fGgavJwp2%akpm@linux-foundation.org> In-Reply-To: <20220121221021.60533b009c357d660791476e@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: 266834000E X-Stat-Signature: 9r7gu64zsa4x1soriek8wzuk6znhoshk Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ai8Xs2Yf; spf=pass (imf07.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam01 X-HE-Tag: 1642831872-890619 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Stephen Kitt Subject: sysctl: make ngroups_max const ngroups_max is a read-only sysctl entry, reflecting NGROUPS_MAX. Make it const, in the same way as cap_last_cap. Link: https://lkml.kernel.org/r/20211123202347.818157-6-mcgrof@kernel.org Signed-off-by: Stephen Kitt Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton --- kernel/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/sysctl.c~sysctl-make-ngroups_max-const +++ a/kernel/sysctl.c @@ -125,7 +125,7 @@ static unsigned long dirty_bytes_min = 2 static int maxolduid = 65535; static int minolduid; -static int ngroups_max = NGROUPS_MAX; +static const int ngroups_max = NGROUPS_MAX; static const int cap_last_cap = CAP_LAST_CAP; @@ -2291,7 +2291,7 @@ static struct ctl_table kern_table[] = { #endif { .procname = "ngroups_max", - .data = &ngroups_max, + .data = (void *)&ngroups_max, .maxlen = sizeof (int), .mode = 0444, .proc_handler = proc_dointvec,