[PATCH v2 7/9] sysctl: use SYSCTL_ZERO to replace some static int zero uses

From: Luis Chamberlain
Date: Tue Nov 23 2021 - 15:24:48 EST


From: Xiaoming Ni <nixiaoming@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
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