kernel/sysctl.c: use DECLARE_SYSCTL_BASE()
Use DECLARE_SYSCTL_BASE() so that if we end up moving all
sysctls from one domain to their respective codebase they can
simply later just move their respective register_sysctl_base()
call. This will make the change easier to read and understand.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 2888e2b..1ca3a0d 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2838,33 +2838,18 @@ static struct ctl_table dev_table[] = {
{ }
};
-static struct ctl_table sysctl_base_table[] = {
- {
- .procname = "kernel",
- .mode = 0555,
- .child = kern_table,
- },
- {
- .procname = "vm",
- .mode = 0555,
- .child = vm_table,
- },
- {
- .procname = "debug",
- .mode = 0555,
- .child = debug_table,
- },
- {
- .procname = "dev",
- .mode = 0555,
- .child = dev_table,
- },
- { }
-};
+DECLARE_SYSCTL_BASE(kernel, kern_table);
+DECLARE_SYSCTL_BASE(vm, vm_table);
+DECLARE_SYSCTL_BASE(debug, debug_table);
+DECLARE_SYSCTL_BASE(dev, dev_table);
int __init sysctl_init(void)
{
- register_sysctl_base(sysctl);
+ register_sysctl_base(kernel);
+ register_sysctl_base(vm);
+ register_sysctl_base(debug);
+ register_sysctl_base(dev);
+
return 0;
}
#endif /* CONFIG_SYSCTL */