Skip to content

Commit

Permalink
Input: sysrq - drop tty argument from sysrq ops handlers
Browse files Browse the repository at this point in the history
Noone is using tty argument so let's get rid of it.

Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Aug 20, 2010
1 parent da5cabf commit 1495cc9
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion arch/arm/kernel/etm.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void etm_dump(void)
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");
etm_dump();
Expand Down
5 changes: 2 additions & 3 deletions arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2880,15 +2880,14 @@ static void xmon_init(int enable)
}

#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 */
xmon_init(1);
debugger(get_irq_regs());
}

static struct sysrq_key_op sysrq_xmon_op =
{
static struct sysrq_key_op sysrq_xmon_op = {
.handler = sysrq_handle_xmon,
.help_msg = "Xmon",
.action_msg = "Entering xmon",
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void arch_trigger_all_cpu_backtrace(void)

#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();
}
Expand Down
42 changes: 21 additions & 21 deletions drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int __init sysrq_always_enabled_setup(char *str)
__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;

Expand All @@ -93,7 +93,7 @@ static struct sysrq_key_op sysrq_loglevel_op = {
};

#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;
schedule_work(SAK_work);
Expand All @@ -109,7 +109,7 @@ static struct sysrq_key_op sysrq_SAK_op = {
#endif

#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];

Expand All @@ -126,7 +126,7 @@ static struct sysrq_key_op sysrq_unraw_op = {
#define sysrq_unraw_op (*(struct sysrq_key_op *)NULL)
#endif /* CONFIG_VT */

static void sysrq_handle_crash(int key, struct tty_struct *tty)
static void sysrq_handle_crash(int key)
{
char *killer = NULL;

Expand All @@ -141,7 +141,7 @@ static struct sysrq_key_op sysrq_crash_op = {
.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();
local_irq_enable();
Expand All @@ -154,7 +154,7 @@ static struct sysrq_key_op sysrq_reboot_op = {
.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();
}
Expand All @@ -165,7 +165,7 @@ static struct sysrq_key_op sysrq_sync_op = {
.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();
}
Expand All @@ -176,7 +176,7 @@ static struct sysrq_key_op sysrq_show_timers_op = {
.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();
}
Expand All @@ -188,7 +188,7 @@ static struct sysrq_key_op sysrq_mountro_op = {
};

#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();
}
Expand Down Expand Up @@ -226,7 +226,7 @@ static void sysrq_showregs_othercpus(struct work_struct *dummy)

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
Expand All @@ -252,7 +252,7 @@ static struct sysrq_key_op sysrq_showallcpus_op = {
};
#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();
if (regs)
Expand All @@ -266,7 +266,7 @@ static struct sysrq_key_op sysrq_showregs_op = {
.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();
}
Expand All @@ -277,7 +277,7 @@ static struct sysrq_key_op sysrq_showstate_op = {
.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);
}
Expand All @@ -291,7 +291,7 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = {
#ifdef CONFIG_TRACING
#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);
}
Expand All @@ -305,7 +305,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = {
#define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL)
#endif

static void sysrq_handle_showmem(int key, struct tty_struct *tty)
static void sysrq_handle_showmem(int key)
{
show_mem();
}
Expand All @@ -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);
console_loglevel = 8;
Expand All @@ -349,7 +349,7 @@ static void moom_callback(struct work_struct *ignored)

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);
}
Expand All @@ -361,7 +361,7 @@ static struct sysrq_key_op sysrq_moom_op = {
};

#ifdef CONFIG_BLOCK
static void sysrq_handle_thaw(int key, struct tty_struct *tty)
static void sysrq_handle_thaw(int key)
{
emergency_thaw_all();
}
Expand All @@ -373,7 +373,7 @@ static struct sysrq_key_op sysrq_thaw_op = {
};
#endif

static void sysrq_handle_kill(int key, struct tty_struct *tty)
static void sysrq_handle_kill(int key)
{
send_sig_all(SIGKILL);
console_loglevel = 8;
Expand All @@ -385,7 +385,7 @@ static struct sysrq_key_op sysrq_kill_op = {
.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();
}
Expand Down Expand Up @@ -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)) {
printk("%s\n", op_p->action_msg);
console_loglevel = orig_log_level;
op_p->handler(key, tty);
op_p->handler(key);
} else {
printk("This sysrq operation is disabled.\n");
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 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);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ibm_newemac/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void emac_dbg_dump_all(void)
}

#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();
}
Expand Down
6 changes: 5 additions & 1 deletion include/linux/sysrq.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct tty_struct;
#define SYSRQ_ENABLE_RTNICE 0x0100

struct sysrq_key_op {
void (*handler)(int, struct tty_struct *);
void (*handler)(int);
char *help_msg;
char *action_msg;
int enable_mask;
Expand All @@ -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)
{
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion kernel/debug/debug_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ static struct console kgdbcons = {
};

#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) {
printk(KERN_CRIT "ERROR: No KGDB I/O module available\n");
Expand Down
2 changes: 1 addition & 1 deletion kernel/power/poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void do_poweroff(struct work_struct *dummy)

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 */
schedule_work_on(cpumask_first(cpu_online_mask), &poweroff_work);
Expand Down

0 comments on commit 1495cc9

Please sign in to comment.