diff options
| author | Oleg Nesterov <oleg@redhat.com> | 2026-08-30 17:33:33 +0200 |
|---|---|---|
| committer | Joel Granados <joel.granados@kernel.org> | 2026-09-14 16:17:44 +0200 |
| commit | acd19f2c56f20725fde8bc60067d165634dda932 (patch) | |
| tree | c8629880a65c6282cc0900e406cdb5464a689840 | |
| parent | 1da0344016a7094ced23dce104a93af535e8ba83 (diff) | |
| download | linux-next-acd19f2c56f20725fde8bc60067d165634dda932.tar.gz linux-next-acd19f2c56f20725fde8bc60067d165634dda932.zip | |
sysctl: collapse redundant CONFIG_SYSCTL nesting in kernel/sysctl.c
After the removal of CONFIG_PROC_SYSCTL, several #ifdef CONFIG_SYSCTL
blocks ended up nested inside the outer (now the same) CONFIG_SYSCTL
guards.
Collapse them and remove a now-stale "/proc/sys support" comment which
referred to CONFIG_PROC_SYSCTL.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Bradley Morgan <include@grrlz.net>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
| -rw-r--r-- | kernel/sysctl.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 25577ffc2801..4efe084455c2 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -29,14 +29,12 @@ EXPORT_SYMBOL(sysctl_vals); const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX }; EXPORT_SYMBOL_GPL(sysctl_long_vals); -#if defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL /* Constants used for minimum and maximum */ static const int ngroups_max = NGROUPS_MAX; static const int cap_last_cap = CAP_LAST_CAP; -#ifdef CONFIG_SYSCTL - /** * enum sysctl_writes_mode - supported sysctl write modes * @@ -64,14 +62,6 @@ enum sysctl_writes_mode { }; static enum sysctl_writes_mode sysctl_writes_strict = SYSCTL_WRITES_STRICT; -#endif /* CONFIG_SYSCTL */ -#endif /* CONFIG_SYSCTL */ - -/* - * /proc/sys support - */ - -#ifdef CONFIG_SYSCTL static int _proc_do_string(char *data, int maxlen, int dir, char *buffer, size_t *lenp, loff_t *ppos) @@ -1443,7 +1433,7 @@ int proc_do_large_bitmap(const struct ctl_table *table, int dir, #endif /* CONFIG_SYSCTL */ -#if defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL int proc_do_static_key(const struct ctl_table *table, int dir, void *buffer, size_t *lenp, loff_t *ppos) { @@ -1475,7 +1465,6 @@ int proc_do_static_key(const struct ctl_table *table, int dir, } static const struct ctl_table sysctl_subsys_table[] = { -#ifdef CONFIG_SYSCTL { .procname = "sysctl_writes_strict", .data = &sysctl_writes_strict, @@ -1485,7 +1474,6 @@ static const struct ctl_table sysctl_subsys_table[] = { .extra1 = SYSCTL_NEG_ONE, .extra2 = SYSCTL_ONE, }, -#endif { .procname = "ngroups_max", .data = (void *)&ngroups_max, |
