提交 1495cc9d 编写于 作者: D Dmitry Torokhov

Input: sysrq - drop tty argument from sysrq ops handlers

Noone is using tty argument so let's get rid of it.
Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: NJason Wessel <jason.wessel@windriver.com>
Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 da5cabf8
...@@ -230,7 +230,7 @@ static void etm_dump(void) ...@@ -230,7 +230,7 @@ static void etm_dump(void)
etb_lock(t); etb_lock(t);
} }
static void sysrq_etm_dump(int key, struct tty_struct *tty) static void sysrq_etm_dump(int key)
{ {
dev_dbg(tracer.dev, "Dumping ETB buffer\n"); dev_dbg(tracer.dev, "Dumping ETB buffer\n");
etm_dump(); etm_dump();
......
...@@ -2880,15 +2880,14 @@ static void xmon_init(int enable) ...@@ -2880,15 +2880,14 @@ static void xmon_init(int enable)
} }
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_xmon(int key, struct tty_struct *tty) static void sysrq_handle_xmon(int key)
{ {
/* ensure xmon is enabled */ /* ensure xmon is enabled */
xmon_init(1); xmon_init(1);
debugger(get_irq_regs()); debugger(get_irq_regs());
} }
static struct sysrq_key_op sysrq_xmon_op = static struct sysrq_key_op sysrq_xmon_op = {
{
.handler = sysrq_handle_xmon, .handler = sysrq_handle_xmon,
.help_msg = "Xmon", .help_msg = "Xmon",
.action_msg = "Entering xmon", .action_msg = "Entering xmon",
......
...@@ -303,7 +303,7 @@ void arch_trigger_all_cpu_backtrace(void) ...@@ -303,7 +303,7 @@ void arch_trigger_all_cpu_backtrace(void)
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_globreg(int key, struct tty_struct *tty) static void sysrq_handle_globreg(int key)
{ {
arch_trigger_all_cpu_backtrace(); arch_trigger_all_cpu_backtrace();
} }
......
...@@ -76,7 +76,7 @@ static int __init sysrq_always_enabled_setup(char *str) ...@@ -76,7 +76,7 @@ static int __init sysrq_always_enabled_setup(char *str)
__setup("sysrq_always_enabled", sysrq_always_enabled_setup); __setup("sysrq_always_enabled", sysrq_always_enabled_setup);
static void sysrq_handle_loglevel(int key, struct tty_struct *tty) static void sysrq_handle_loglevel(int key)
{ {
int i; int i;
...@@ -93,7 +93,7 @@ static struct sysrq_key_op sysrq_loglevel_op = { ...@@ -93,7 +93,7 @@ static struct sysrq_key_op sysrq_loglevel_op = {
}; };
#ifdef CONFIG_VT #ifdef CONFIG_VT
static void sysrq_handle_SAK(int key, struct tty_struct *tty) static void sysrq_handle_SAK(int key)
{ {
struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work;
schedule_work(SAK_work); schedule_work(SAK_work);
...@@ -109,7 +109,7 @@ static struct sysrq_key_op sysrq_SAK_op = { ...@@ -109,7 +109,7 @@ static struct sysrq_key_op sysrq_SAK_op = {
#endif #endif
#ifdef CONFIG_VT #ifdef CONFIG_VT
static void sysrq_handle_unraw(int key, struct tty_struct *tty) static void sysrq_handle_unraw(int key)
{ {
struct kbd_struct *kbd = &kbd_table[fg_console]; struct kbd_struct *kbd = &kbd_table[fg_console];
...@@ -126,7 +126,7 @@ static struct sysrq_key_op sysrq_unraw_op = { ...@@ -126,7 +126,7 @@ static struct sysrq_key_op sysrq_unraw_op = {
#define sysrq_unraw_op (*(struct sysrq_key_op *)NULL) #define sysrq_unraw_op (*(struct sysrq_key_op *)NULL)
#endif /* CONFIG_VT */ #endif /* CONFIG_VT */
static void sysrq_handle_crash(int key, struct tty_struct *tty) static void sysrq_handle_crash(int key)
{ {
char *killer = NULL; char *killer = NULL;
...@@ -141,7 +141,7 @@ static struct sysrq_key_op sysrq_crash_op = { ...@@ -141,7 +141,7 @@ static struct sysrq_key_op sysrq_crash_op = {
.enable_mask = SYSRQ_ENABLE_DUMP, .enable_mask = SYSRQ_ENABLE_DUMP,
}; };
static void sysrq_handle_reboot(int key, struct tty_struct *tty) static void sysrq_handle_reboot(int key)
{ {
lockdep_off(); lockdep_off();
local_irq_enable(); local_irq_enable();
...@@ -154,7 +154,7 @@ static struct sysrq_key_op sysrq_reboot_op = { ...@@ -154,7 +154,7 @@ static struct sysrq_key_op sysrq_reboot_op = {
.enable_mask = SYSRQ_ENABLE_BOOT, .enable_mask = SYSRQ_ENABLE_BOOT,
}; };
static void sysrq_handle_sync(int key, struct tty_struct *tty) static void sysrq_handle_sync(int key)
{ {
emergency_sync(); emergency_sync();
} }
...@@ -165,7 +165,7 @@ static struct sysrq_key_op sysrq_sync_op = { ...@@ -165,7 +165,7 @@ static struct sysrq_key_op sysrq_sync_op = {
.enable_mask = SYSRQ_ENABLE_SYNC, .enable_mask = SYSRQ_ENABLE_SYNC,
}; };
static void sysrq_handle_show_timers(int key, struct tty_struct *tty) static void sysrq_handle_show_timers(int key)
{ {
sysrq_timer_list_show(); sysrq_timer_list_show();
} }
...@@ -176,7 +176,7 @@ static struct sysrq_key_op sysrq_show_timers_op = { ...@@ -176,7 +176,7 @@ static struct sysrq_key_op sysrq_show_timers_op = {
.action_msg = "Show clockevent devices & pending hrtimers (no others)", .action_msg = "Show clockevent devices & pending hrtimers (no others)",
}; };
static void sysrq_handle_mountro(int key, struct tty_struct *tty) static void sysrq_handle_mountro(int key)
{ {
emergency_remount(); emergency_remount();
} }
...@@ -188,7 +188,7 @@ static struct sysrq_key_op sysrq_mountro_op = { ...@@ -188,7 +188,7 @@ static struct sysrq_key_op sysrq_mountro_op = {
}; };
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
static void sysrq_handle_showlocks(int key, struct tty_struct *tty) static void sysrq_handle_showlocks(int key)
{ {
debug_show_all_locks(); debug_show_all_locks();
} }
...@@ -226,7 +226,7 @@ static void sysrq_showregs_othercpus(struct work_struct *dummy) ...@@ -226,7 +226,7 @@ static void sysrq_showregs_othercpus(struct work_struct *dummy)
static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus); static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus);
static void sysrq_handle_showallcpus(int key, struct tty_struct *tty) static void sysrq_handle_showallcpus(int key)
{ {
/* /*
* Fall back to the workqueue based printing if the * Fall back to the workqueue based printing if the
...@@ -252,7 +252,7 @@ static struct sysrq_key_op sysrq_showallcpus_op = { ...@@ -252,7 +252,7 @@ static struct sysrq_key_op sysrq_showallcpus_op = {
}; };
#endif #endif
static void sysrq_handle_showregs(int key, struct tty_struct *tty) static void sysrq_handle_showregs(int key)
{ {
struct pt_regs *regs = get_irq_regs(); struct pt_regs *regs = get_irq_regs();
if (regs) if (regs)
...@@ -266,7 +266,7 @@ static struct sysrq_key_op sysrq_showregs_op = { ...@@ -266,7 +266,7 @@ static struct sysrq_key_op sysrq_showregs_op = {
.enable_mask = SYSRQ_ENABLE_DUMP, .enable_mask = SYSRQ_ENABLE_DUMP,
}; };
static void sysrq_handle_showstate(int key, struct tty_struct *tty) static void sysrq_handle_showstate(int key)
{ {
show_state(); show_state();
} }
...@@ -277,7 +277,7 @@ static struct sysrq_key_op sysrq_showstate_op = { ...@@ -277,7 +277,7 @@ static struct sysrq_key_op sysrq_showstate_op = {
.enable_mask = SYSRQ_ENABLE_DUMP, .enable_mask = SYSRQ_ENABLE_DUMP,
}; };
static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) static void sysrq_handle_showstate_blocked(int key)
{ {
show_state_filter(TASK_UNINTERRUPTIBLE); show_state_filter(TASK_UNINTERRUPTIBLE);
} }
...@@ -291,7 +291,7 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = { ...@@ -291,7 +291,7 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = {
#ifdef CONFIG_TRACING #ifdef CONFIG_TRACING
#include <linux/ftrace.h> #include <linux/ftrace.h>
static void sysrq_ftrace_dump(int key, struct tty_struct *tty) static void sysrq_ftrace_dump(int key)
{ {
ftrace_dump(DUMP_ALL); ftrace_dump(DUMP_ALL);
} }
...@@ -305,7 +305,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = { ...@@ -305,7 +305,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = {
#define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL) #define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL)
#endif #endif
static void sysrq_handle_showmem(int key, struct tty_struct *tty) static void sysrq_handle_showmem(int key)
{ {
show_mem(); show_mem();
} }
...@@ -330,7 +330,7 @@ static void send_sig_all(int sig) ...@@ -330,7 +330,7 @@ static void send_sig_all(int sig)
} }
} }
static void sysrq_handle_term(int key, struct tty_struct *tty) static void sysrq_handle_term(int key)
{ {
send_sig_all(SIGTERM); send_sig_all(SIGTERM);
console_loglevel = 8; console_loglevel = 8;
...@@ -349,7 +349,7 @@ static void moom_callback(struct work_struct *ignored) ...@@ -349,7 +349,7 @@ static void moom_callback(struct work_struct *ignored)
static DECLARE_WORK(moom_work, moom_callback); static DECLARE_WORK(moom_work, moom_callback);
static void sysrq_handle_moom(int key, struct tty_struct *tty) static void sysrq_handle_moom(int key)
{ {
schedule_work(&moom_work); schedule_work(&moom_work);
} }
...@@ -361,7 +361,7 @@ static struct sysrq_key_op sysrq_moom_op = { ...@@ -361,7 +361,7 @@ static struct sysrq_key_op sysrq_moom_op = {
}; };
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
static void sysrq_handle_thaw(int key, struct tty_struct *tty) static void sysrq_handle_thaw(int key)
{ {
emergency_thaw_all(); emergency_thaw_all();
} }
...@@ -373,7 +373,7 @@ static struct sysrq_key_op sysrq_thaw_op = { ...@@ -373,7 +373,7 @@ static struct sysrq_key_op sysrq_thaw_op = {
}; };
#endif #endif
static void sysrq_handle_kill(int key, struct tty_struct *tty) static void sysrq_handle_kill(int key)
{ {
send_sig_all(SIGKILL); send_sig_all(SIGKILL);
console_loglevel = 8; console_loglevel = 8;
...@@ -385,7 +385,7 @@ static struct sysrq_key_op sysrq_kill_op = { ...@@ -385,7 +385,7 @@ static struct sysrq_key_op sysrq_kill_op = {
.enable_mask = SYSRQ_ENABLE_SIGNAL, .enable_mask = SYSRQ_ENABLE_SIGNAL,
}; };
static void sysrq_handle_unrt(int key, struct tty_struct *tty) static void sysrq_handle_unrt(int key)
{ {
normalize_rt_tasks(); normalize_rt_tasks();
} }
...@@ -520,7 +520,7 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) ...@@ -520,7 +520,7 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
printk("%s\n", op_p->action_msg); printk("%s\n", op_p->action_msg);
console_loglevel = orig_log_level; console_loglevel = orig_log_level;
op_p->handler(key, tty); op_p->handler(key);
} else { } else {
printk("This sysrq operation is disabled.\n"); printk("This sysrq operation is disabled.\n");
} }
......
...@@ -369,7 +369,7 @@ static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) ...@@ -369,7 +369,7 @@ static void drm_fb_helper_restore_work_fn(struct work_struct *ignored)
} }
static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn); static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn);
static void drm_fb_helper_sysrq(int dummy1, struct tty_struct *dummy3) static void drm_fb_helper_sysrq(int dummy1)
{ {
schedule_work(&drm_fb_helper_restore_work); schedule_work(&drm_fb_helper_restore_work);
} }
......
...@@ -238,7 +238,7 @@ void emac_dbg_dump_all(void) ...@@ -238,7 +238,7 @@ void emac_dbg_dump_all(void)
} }
#if defined(CONFIG_MAGIC_SYSRQ) #if defined(CONFIG_MAGIC_SYSRQ)
static void emac_sysrq_handler(int key, struct tty_struct *tty) static void emac_sysrq_handler(int key)
{ {
emac_dbg_dump_all(); emac_dbg_dump_all();
} }
......
...@@ -31,7 +31,7 @@ struct tty_struct; ...@@ -31,7 +31,7 @@ struct tty_struct;
#define SYSRQ_ENABLE_RTNICE 0x0100 #define SYSRQ_ENABLE_RTNICE 0x0100
struct sysrq_key_op { struct sysrq_key_op {
void (*handler)(int, struct tty_struct *); void (*handler)(int);
char *help_msg; char *help_msg;
char *action_msg; char *action_msg;
int enable_mask; int enable_mask;
...@@ -58,6 +58,10 @@ static inline void handle_sysrq(int key, struct tty_struct *tty) ...@@ -58,6 +58,10 @@ static inline void handle_sysrq(int key, struct tty_struct *tty)
{ {
} }
static inline void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
{
}
static inline int register_sysrq_key(int key, struct sysrq_key_op *op) static inline int register_sysrq_key(int key, struct sysrq_key_op *op)
{ {
return -EINVAL; return -EINVAL;
......
...@@ -741,7 +741,7 @@ static struct console kgdbcons = { ...@@ -741,7 +741,7 @@ static struct console kgdbcons = {
}; };
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_dbg(int key, struct tty_struct *tty) static void sysrq_handle_dbg(int key)
{ {
if (!dbg_io_ops) { if (!dbg_io_ops) {
printk(KERN_CRIT "ERROR: No KGDB I/O module available\n"); printk(KERN_CRIT "ERROR: No KGDB I/O module available\n");
......
...@@ -24,7 +24,7 @@ static void do_poweroff(struct work_struct *dummy) ...@@ -24,7 +24,7 @@ static void do_poweroff(struct work_struct *dummy)
static DECLARE_WORK(poweroff_work, do_poweroff); static DECLARE_WORK(poweroff_work, do_poweroff);
static void handle_poweroff(int key, struct tty_struct *tty) static void handle_poweroff(int key)
{ {
/* run sysrq poweroff on boot cpu */ /* run sysrq poweroff on boot cpu */
schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work); schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册