From 79ac8df97408b97175c01b6bff5ce0a97f35b439 Mon Sep 17 00:00:00 2001 From: Joel Granados Date: Fri, 2 May 2025 22:47:06 +0200 Subject: Input: sysrq: mv sysrq into drivers/tty/sysrq.c Move both sysrq ctl_table and supported sysrq_sysctl_handler helper function into drivers/tty/sysrq.c. Replaced the __do_proc_dointvec in helper function with do_proc_dointvec_minmax as the former is local to kernel/sysctl.c. Here we use the minmax version of do_proc_dointvec because do_proc_dointvec is static and calling do_proc_dointvec_minmax with a NULL min and max is the same as calling do_proc_dointvec. 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: Kees Cook Acked-by: Greg Kroah-Hartman Signed-off-by: Joel Granados --- kernel/sysctl.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'kernel/sysctl.c') diff --git a/kernel/sysctl.c b/kernel/sysctl.c index febf328054aa..ebcc7d75acd9 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -964,26 +963,6 @@ int proc_dou8vec_minmax(const struct ctl_table *table, int write, } EXPORT_SYMBOL_GPL(proc_dou8vec_minmax); -#ifdef CONFIG_MAGIC_SYSRQ -static int sysrq_sysctl_handler(const struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) -{ - int tmp, ret; - - tmp = sysrq_mask(); - - ret = __do_proc_dointvec(&tmp, table, write, buffer, - lenp, ppos, NULL, NULL); - if (ret || !write) - return ret; - - if (write) - sysrq_toggle_support(tmp); - - return 0; -} -#endif - static int __do_proc_doulongvec_minmax(void *data, const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, @@ -1612,15 +1591,6 @@ static const struct ctl_table kern_table[] = { .proc_handler = proc_dostring, }, #endif -#ifdef CONFIG_MAGIC_SYSRQ - { - .procname = "sysrq", - .data = NULL, - .maxlen = sizeof (int), - .mode = 0644, - .proc_handler = sysrq_sysctl_handler, - }, -#endif #ifdef CONFIG_PROC_SYSCTL { .procname = "cad_pid", -- cgit v1.2.3