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

Configure Feed

Select the types of activity you want to include in your feed.

sparc: mv sparc sysctls into their own file under arch/sparc/kernel

Move sparc sysctls (reboot-cmd, stop-a, scons-poweroff and tsb-ratio)
into a new file (arch/sparc/kernel/setup.c). This file will be included
for both 32 and 64 bit sparc. Leave "tsb-ratio" under SPARC64 ifdef as
it was in kernel/sysctl.c. The sysctl table register is called with
arch_initcall placing it after its original place in proc_root_init.

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.

Signed-off-by: Joel Granados <joel.granados@kernel.org>

+47 -35
+1
arch/sparc/kernel/Makefile
··· 35 35 obj-y += signal_$(BITS).o 36 36 obj-y += sigutil_$(BITS).o 37 37 obj-$(CONFIG_SPARC32) += ioport.o 38 + obj-y += setup.o 38 39 obj-y += setup_$(BITS).o 39 40 obj-y += idprom.o 40 41 obj-y += sys_sparc_$(BITS).o
+46
arch/sparc/kernel/setup.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <asm/setup.h> 4 + #include <linux/sysctl.h> 5 + 6 + static const struct ctl_table sparc_sysctl_table[] = { 7 + { 8 + .procname = "reboot-cmd", 9 + .data = reboot_command, 10 + .maxlen = 256, 11 + .mode = 0644, 12 + .proc_handler = proc_dostring, 13 + }, 14 + { 15 + .procname = "stop-a", 16 + .data = &stop_a_enabled, 17 + .maxlen = sizeof(int), 18 + .mode = 0644, 19 + .proc_handler = proc_dointvec, 20 + }, 21 + { 22 + .procname = "scons-poweroff", 23 + .data = &scons_pwroff, 24 + .maxlen = sizeof(int), 25 + .mode = 0644, 26 + .proc_handler = proc_dointvec, 27 + }, 28 + #ifdef CONFIG_SPARC64 29 + { 30 + .procname = "tsb-ratio", 31 + .data = &sysctl_tsb_ratio, 32 + .maxlen = sizeof(int), 33 + .mode = 0644, 34 + .proc_handler = proc_dointvec, 35 + }, 36 + #endif 37 + }; 38 + 39 + 40 + static int __init init_sparc_sysctls(void) 41 + { 42 + register_sysctl_init("kernel", sparc_sysctl_table); 43 + return 0; 44 + } 45 + 46 + arch_initcall(init_sparc_sysctls);
-35
kernel/sysctl.c
··· 60 60 #include <asm/nmi.h> 61 61 #include <asm/io.h> 62 62 #endif 63 - #ifdef CONFIG_SPARC 64 - #include <asm/setup.h> 65 - #endif 66 63 #ifdef CONFIG_RT_MUTEXES 67 64 #include <linux/rtmutex.h> 68 65 #endif ··· 1596 1599 .proc_handler = proc_dointvec_minmax, 1597 1600 .extra1 = SYSCTL_NEG_ONE, 1598 1601 .extra2 = SYSCTL_ONE, 1599 - }, 1600 - #endif 1601 - #ifdef CONFIG_SPARC 1602 - { 1603 - .procname = "reboot-cmd", 1604 - .data = reboot_command, 1605 - .maxlen = 256, 1606 - .mode = 0644, 1607 - .proc_handler = proc_dostring, 1608 - }, 1609 - { 1610 - .procname = "stop-a", 1611 - .data = &stop_a_enabled, 1612 - .maxlen = sizeof (int), 1613 - .mode = 0644, 1614 - .proc_handler = proc_dointvec, 1615 - }, 1616 - { 1617 - .procname = "scons-poweroff", 1618 - .data = &scons_pwroff, 1619 - .maxlen = sizeof (int), 1620 - .mode = 0644, 1621 - .proc_handler = proc_dointvec, 1622 - }, 1623 - #endif 1624 - #ifdef CONFIG_SPARC64 1625 - { 1626 - .procname = "tsb-ratio", 1627 - .data = &sysctl_tsb_ratio, 1628 - .maxlen = sizeof (int), 1629 - .mode = 0644, 1630 - .proc_handler = proc_dointvec, 1631 1602 }, 1632 1603 #endif 1633 1604 #ifdef CONFIG_PARISC