x86: simplify sysctl registrations
Subsystems (4)
cover x86: simplify sysctl registrations
These are trivial conversions to reduce more code and avoid API calls that we are deprecating [0].
[0] https://lore.kernel.org/all/[email protected]/T/#u
Luis Chamberlain (2):
x86: simplify one-level sysctl registration for abi_table2
x86: simplify one-level sysctl registration for itmt_kern_table
arch/x86/entry/vdso/vdso32-setup.c | 11 +---------- arch/x86/kernel/itmt.c | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-)
Signature · 1 line
2.39.1
PATCH 2/2 x86: simplify one-level sysctl registration for itmt_kern_table
There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl().
Simplify this registration.
--- arch/x86/kernel/itmt.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
arch/x86/kernel/itmt.c +1 -10
@@ -77,15 +77,6 @@ static struct ctl_table itmt_kern_table[] = { {} }; -static struct ctl_table itmt_root_table[] = { - { - .procname ="kernel" , - .mode =0555 , - .child = itmt_kern_table, - }, - {} -}; -static struct ctl_table_header *itmt_sysctl_header;/**
@@ -114,7 +105,7 @@ int sched_set_itmt_support(void)return 0 ; } - itmt_sysctl_header =register_sysctl_table (itmt_root_table); + itmt_sysctl_header =register_sysctl ("kernel" , itmt_kern_table);if (!itmt_sysctl_header) {mutex_unlock (&itmt_update_mutex);return -ENOMEM ;
Signature · 1 line
2.39.1
PATCH 1/2 x86: simplify one-level sysctl registration for abi_table2
In reply to Luis ChamberlainThere is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl().
Simplify this registration.
--- arch/x86/entry/vdso/vdso32-setup.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
arch/x86/entry/vdso/vdso32-setup.c +1 -10
@@ -70,18 +70,9 @@ static struct ctl_table abi_table2[] = { {} }; -static struct ctl_table abi_root_table2[] = { - { - .procname ="abi" , - .mode =0555 , - .child = abi_table2 - }, - {} -}; -static __init int ia32_binfmt_init (void ) { -register_sysctl_table (abi_root_table2); +register_sysctl ("abi" , abi_table2);return 0 ; }__initcall (ia32_binfmt_init);
Signature · 1 line
2.39.1