[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211123202347.818157-8-mcgrof@kernel.org>
Date: Tue, 23 Nov 2021 12:23:45 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: akpm@...ux-foundation.org, keescook@...omium.org,
yzaikin@...gle.com, nixiaoming@...wei.com, ebiederm@...ssion.com,
peterz@...radead.org, gregkh@...uxfoundation.org, pjt@...gle.com,
liu.hailong6@....com.cn, andriy.shevchenko@...ux.intel.com,
sre@...nel.org, penguin-kernel@...ove.sakura.ne.jp,
pmladek@...e.com, senozhatsky@...omium.org, wangqing@...o.com,
bcrl@...ck.org, viro@...iv.linux.org.uk, jack@...e.cz,
amir73il@...il.com
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH v2 7/9] sysctl: use SYSCTL_ZERO to replace some static int zero uses
From: Xiaoming Ni <nixiaoming@...wei.com>
Use the variable SYSCTL_ZERO to replace some static int boundary
variables with a value of 0 (minolduid, min_extfrag_threshold,
min_wakeup_granularity_ns).
Signed-off-by: Xiaoming Ni <nixiaoming@...wei.com>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
kernel/sysctl.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 03bbd26d4df0..597ab5ad4879 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -122,7 +122,7 @@ static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
static const int maxolduid = 65535;
-static const int minolduid;
+/* minolduid is SYSCTL_ZERO */
static const int ngroups_max = NGROUPS_MAX;
static const int cap_last_cap = CAP_LAST_CAP;
@@ -170,7 +170,7 @@ int sysctl_legacy_va_layout;
#endif
#ifdef CONFIG_COMPACTION
-static const int min_extfrag_threshold;
+/* min_extfrag_threshold is SYSCTL_ZERO */;
static const int max_extfrag_threshold = 1000;
#endif
@@ -2175,7 +2175,7 @@ static struct ctl_table kern_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)&minolduid,
+ .extra1 = SYSCTL_ZERO,
.extra2 = (void *)&maxolduid,
},
{
@@ -2184,7 +2184,7 @@ static struct ctl_table kern_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)&minolduid,
+ .extra1 = SYSCTL_ZERO,
.extra2 = (void *)&maxolduid,
},
#ifdef CONFIG_S390
@@ -2758,7 +2758,7 @@ static struct ctl_table vm_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)&min_extfrag_threshold,
+ .extra1 = SYSCTL_ZERO,
.extra2 = (void *)&max_extfrag_threshold,
},
{
@@ -3070,7 +3070,7 @@ static struct ctl_table fs_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)&minolduid,
+ .extra1 = SYSCTL_ZERO,
.extra2 = (void *)&maxolduid,
},
{
@@ -3079,7 +3079,7 @@ static struct ctl_table fs_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)&minolduid,
+ .extra1 = SYSCTL_ZERO,
.extra2 = (void *)&maxolduid,
},
#ifdef CONFIG_FILE_LOCKING
--
2.33.0
Powered by blists - more mailing lists