]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kernel misc: Remove the now superfluous sentinel elements from ctl_table array
authorJoel Granados <j.granados@samsung.com>
Tue, 27 Jun 2023 13:30:19 +0000 (15:30 +0200)
committerJoel Granados <j.granados@samsung.com>
Wed, 24 Apr 2024 07:43:53 +0000 (09:43 +0200)
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)

Remove the sentinel from ctl_table arrays. Reduce by one the values used
to compare the size of the adjusted arrays.

Signed-off-by: Joel Granados <j.granados@samsung.com>
15 files changed:
kernel/acct.c
kernel/exit.c
kernel/hung_task.c
kernel/kexec_core.c
kernel/latencytop.c
kernel/panic.c
kernel/pid_namespace.c
kernel/pid_sysctl.h
kernel/reboot.c
kernel/signal.c
kernel/stackleak.c
kernel/sysctl.c
kernel/ucount.c
kernel/utsname_sysctl.c
kernel/watchdog.c

index 986c8214dabf25aef1f3b379d3b12ac9f1975ce8..179848ad33e978a557ce695a0d6020aa169177c6 100644 (file)
@@ -84,7 +84,6 @@ static struct ctl_table kern_acct_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       { }
 };
 
 static __init int kernel_acct_sysctls_init(void)
index 41a12630cbbc9cd80b6b5a154041c514b46ad3fe..cd3aa9042f1a115a521a68156f8447a7e211bf37 100644 (file)
@@ -94,7 +94,6 @@ static struct ctl_table kern_exit_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_douintvec,
        },
-       { }
 };
 
 static __init int kernel_exit_sysctls_init(void)
index b2fc2727d65441a3876c72c6d8aa374fda155b8f..1d92016b0b3c427afff4caa91c451c81e6858722 100644 (file)
@@ -314,7 +314,6 @@ static struct ctl_table hung_task_sysctls[] = {
                .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_NEG_ONE,
        },
-       {}
 };
 
 static void __init hung_task_sysctl_init(void)
index 0e96f6b243447368674fd343b6fb90343e79df43..9112d69d68b0b30d423496fc774fa9331f03c637 100644 (file)
@@ -948,7 +948,6 @@ static struct ctl_table kexec_core_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = kexec_limit_handler,
        },
-       { }
 };
 
 static int __init kexec_core_sysctl_init(void)
index 781249098cb6e729b77b81658c217097085e6eb6..84c53285f4999703c67ceb195ccefd618ae9c768 100644 (file)
@@ -85,7 +85,6 @@ static struct ctl_table latencytop_sysctl[] = {
                .mode       = 0644,
                .proc_handler   = sysctl_latencytop,
        },
-       {}
 };
 #endif
 
index 747c3f3d289a234832e6cf5774d92a20951e3cb3..8bff183d6180e752a0a7ba0ea9ed1617322fb02a 100644 (file)
@@ -100,7 +100,6 @@ static struct ctl_table kern_panic_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_douintvec,
        },
-       { }
 };
 
 static __init int kernel_panic_sysctls_init(void)
index 7ade20e95232145512de411b42851e2c85437772..dc48fecfa1dcedfc43179634c6633c935b1ed62f 100644 (file)
@@ -307,7 +307,6 @@ static struct ctl_table pid_ns_ctl_table[] = {
                .extra1 = SYSCTL_ZERO,
                .extra2 = &pid_max,
        },
-       { }
 };
 #endif /* CONFIG_CHECKPOINT_RESTORE */
 
index 2ee41a3a1dfdee623261c86e89116a968d548825..fe9fb991dc42254c252b10c3bff7e5d5fb5c1ed3 100644 (file)
@@ -41,7 +41,6 @@ static struct ctl_table pid_ns_ctl_table_vm[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_TWO,
        },
-       { }
 };
 static inline void register_pid_ns_sysctl_table_vm(void)
 {
index 22c16e2564cca1bc9d6a7f1bc159e2afed68b74f..f05dbde2c93fe709ff01491e8a31e0b3c7b66744 100644 (file)
@@ -1295,7 +1295,6 @@ static struct ctl_table kern_reboot_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       { }
 };
 
 static void __init kernel_reboot_sysctls_init(void)
index 7bdbcf1b78d0fa0d9f3fbde4b61e31ca5595f453..01c4c46a51a82b87c6d70eaf43a4baded87e567b 100644 (file)
@@ -4840,7 +4840,6 @@ static struct ctl_table signal_debug_table[] = {
                .proc_handler   = proc_dointvec
        },
 #endif
-       { }
 };
 
 static int __init init_signal_sysctls(void)
index 34c9d81eea9409410fb289f19108bb7fb8488810..d099f3affcf1a69b185278fca4767527fe1464e3 100644 (file)
@@ -54,7 +54,6 @@ static struct ctl_table stackleak_sysctls[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE,
        },
-       {}
 };
 
 static int __init stackleak_sysctls_init(void)
index 81cc974913bb901ec9319d836d09fbb24bf60c56..e0b917328cf9963003a3b53a136e2b20fb36461c 100644 (file)
@@ -2034,7 +2034,6 @@ static struct ctl_table kern_table[] = {
                .extra2         = SYSCTL_INT_MAX,
        },
 #endif
-       { }
 };
 
 static struct ctl_table vm_table[] = {
@@ -2240,7 +2239,6 @@ static struct ctl_table vm_table[] = {
                .extra2         = (void *)&mmap_rnd_compat_bits_max,
        },
 #endif
-       { }
 };
 
 int __init sysctl_init_bases(void)
index 4aa6166cb8563c5ba47a04a391c797d058ff0a16..e196da0204dcb5773e1f94e539e1c8e2502b21ca 100644 (file)
@@ -87,7 +87,6 @@ static struct ctl_table user_table[] = {
        UCOUNT_ENTRY("max_fanotify_groups"),
        UCOUNT_ENTRY("max_fanotify_marks"),
 #endif
-       { }
 };
 #endif /* CONFIG_SYSCTL */
 
@@ -96,7 +95,7 @@ bool setup_userns_sysctls(struct user_namespace *ns)
 #ifdef CONFIG_SYSCTL
        struct ctl_table *tbl;
 
-       BUILD_BUG_ON(ARRAY_SIZE(user_table) != UCOUNT_COUNTS + 1);
+       BUILD_BUG_ON(ARRAY_SIZE(user_table) != UCOUNT_COUNTS);
        setup_sysctl_set(&ns->set, &set_root, set_is_seen);
        tbl = kmemdup(user_table, sizeof(user_table), GFP_KERNEL);
        if (tbl) {
index 019e3a1566cf56095476bcdc371a3240506766fc..76a772072557f3417abb7da6c2d5892b1405fccf 100644 (file)
@@ -120,7 +120,6 @@ static struct ctl_table uts_kern_table[] = {
                .proc_handler   = proc_do_uts_string,
                .poll           = &domainname_poll,
        },
-       {}
 };
 
 #ifdef CONFIG_PROC_SYSCTL
index d7b2125503af3dd6f9d4b03eee38c14f8d9b3212..4e472d416525b7107d0b271158b4c15d7f598d56 100644 (file)
@@ -950,7 +950,6 @@ static struct ctl_table watchdog_sysctls[] = {
        },
 #endif /* CONFIG_SMP */
 #endif
-       {}
 };
 
 static struct ctl_table watchdog_hardlockup_sysctl[] = {
@@ -963,7 +962,6 @@ static struct ctl_table watchdog_hardlockup_sysctl[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE,
        },
-       {}
 };
 
 static void __init watchdog_sysctl_init(void)