Message ID | 20230522210814.1919325-2-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | kernel/sysctl.c: remove to major base directories | expand |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index fa2aa8bd32b6..a7fdb828afb6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2344,16 +2344,11 @@ static struct ctl_table debug_table[] = { { } }; -static struct ctl_table dev_table[] = { - { } -}; - int __init sysctl_init_bases(void) { register_sysctl_init("kernel", kern_table); register_sysctl_init("vm", vm_table); register_sysctl_init("debug", debug_table); - register_sysctl_init("dev", dev_table); return 0; }
Now that all the dev sysctls have been moved out we can remove the dev sysctl base directory. We don't need to create base directories, they are created for you as if using 'mkdir -p' with register_syctl() and register_sysctl_init(). For details refer to sysctl_mkdir_p() usage. We save 90 bytes with this changes: ./scripts/bloat-o-meter vmlinux.2.remove-sysctl-table vmlinux.3-remove-dev-table add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-90 (-90) Function old new delta sysctl_init_bases 111 85 -26 dev_table 64 - -64 Total: Before=21257057, After=21256967, chg -0.00% Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> --- kernel/sysctl.c | 5 ----- 1 file changed, 5 deletions(-)