Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc/power: Move soft-power into power.c

Move the soft-power ctl table into parisc/power.c. As a consequence the
pwrsw_enabled var is made static.

This is part of a greater effort to move ctl tables into their
respective subsystems which will reduce the merge conflicts in
kernel/sysctl.c.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>

+19 -11
+19 -1
drivers/parisc/power.c
··· 83 83 #define SYSCTL_FILENAME "sys/kernel/power" 84 84 85 85 /* soft power switch enabled/disabled */ 86 - int pwrsw_enabled __read_mostly = 1; 86 + static int pwrsw_enabled __read_mostly = 1; 87 + 88 + static const struct ctl_table power_sysctl_table[] = { 89 + { 90 + .procname = "soft-power", 91 + .data = &pwrsw_enabled, 92 + .maxlen = sizeof(int), 93 + .mode = 0644, 94 + .proc_handler = proc_dointvec, 95 + }, 96 + }; 97 + 98 + static int __init init_power_sysctl(void) 99 + { 100 + register_sysctl_init("kernel", power_sysctl_table); 101 + return 0; 102 + } 103 + 104 + arch_initcall(init_power_sysctl); 87 105 88 106 /* main kernel thread worker. It polls the button state */ 89 107 static int kpowerswd(void *param)
-1
include/linux/sysctl.h
··· 242 242 int write, void *data), 243 243 void *data); 244 244 245 - extern int pwrsw_enabled; 246 245 extern int unaligned_enabled; 247 246 extern int unaligned_dump_stack; 248 247 extern int no_unaligned_warning;
-9
kernel/sysctl.c
··· 1594 1594 .extra2 = SYSCTL_ONE, 1595 1595 }, 1596 1596 #endif 1597 - #ifdef CONFIG_PARISC 1598 - { 1599 - .procname = "soft-power", 1600 - .data = &pwrsw_enabled, 1601 - .maxlen = sizeof (int), 1602 - .mode = 0644, 1603 - .proc_handler = proc_dointvec, 1604 - }, 1605 - #endif 1606 1597 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW 1607 1598 { 1608 1599 .procname = "unaligned-trap",