Skip to content

Commit

Permalink
Input: sysrq - drop tty argument form handle_sysrq()
Browse files Browse the repository at this point in the history
Sysrq operations do not accept tty argument anymore so no need to pass
it to us.

[Stephen Rothwell <sfr@canb.auug.org.au>: fix build breakage in drm code
 caused by sysrq using bool but not including linux/types.h]

[Sachin Sant <sachinp@in.ibm.com>: fix build breakage in s390 keyboadr
 driver]

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 21, 2010
1 parent 1495cc9 commit f335397
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/hp/sim/simserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void receive_chars(struct tty_struct *tty)
ch = ia64_ssc(0, 0, 0, 0,
SSC_GETCHAR);
while (!ch);
handle_sysrq(ch, NULL);
handle_sysrq(ch);
}
#endif
seen_esc = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
static void sysrq_proc(void *arg)
{
char *op = arg;
handle_sysrq(*op, NULL);
handle_sysrq(*op);
}

void mconsole_sysrq(struct mc_request *req)
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hangcheck-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void hangcheck_fire(unsigned long data)
if (hangcheck_dump_tasks) {
printk(KERN_CRIT "Hangcheck: Task state:\n");
#ifdef CONFIG_MAGIC_SYSRQ
handle_sysrq('t', NULL);
handle_sysrq('t');
#endif /* CONFIG_MAGIC_SYSRQ */
}
if (hangcheck_reboot) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ int hvc_poll(struct hvc_struct *hp)
if (sysrq_pressed)
continue;
} else if (sysrq_pressed) {
handle_sysrq(buf[i], tty);
handle_sysrq(buf[i]);
sysrq_pressed = 0;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len)
hp->sysrq = 1;
continue;
} else if (hp->sysrq) {
handle_sysrq(c, hp->tty);
handle_sysrq(c);
hp->sysrq = 0;
continue;
}
Expand Down
11 changes: 5 additions & 6 deletions drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/tty.h>
#include <linux/mount.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
Expand Down Expand Up @@ -493,7 +492,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
sysrq_key_table[i] = op_p;
}

void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
void __handle_sysrq(int key, bool check_mask)
{
struct sysrq_key_op *op_p;
int orig_log_level;
Expand Down Expand Up @@ -545,10 +544,10 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
spin_unlock_irqrestore(&sysrq_key_table_lock, flags);
}

void handle_sysrq(int key, struct tty_struct *tty)
void handle_sysrq(int key)
{
if (sysrq_on())
__handle_sysrq(key, tty, 1);
__handle_sysrq(key, true);
}
EXPORT_SYMBOL(handle_sysrq);

Expand Down Expand Up @@ -597,7 +596,7 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type,

default:
if (sysrq_down && value && value != 2)
__handle_sysrq(sysrq_xlate[code], NULL, 1);
__handle_sysrq(sysrq_xlate[code], true);
break;
}

Expand Down Expand Up @@ -765,7 +764,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,

if (get_user(c, buf))
return -EFAULT;
__handle_sysrq(c, NULL, 0);
__handle_sysrq(c, false);
}

return count;
Expand Down
4 changes: 1 addition & 3 deletions drivers/s390/char/ctrlchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@

#ifdef CONFIG_MAGIC_SYSRQ
static int ctrlchar_sysrq_key;
static struct tty_struct *sysrq_tty;

static void
ctrlchar_handle_sysrq(struct work_struct *work)
{
handle_sysrq(ctrlchar_sysrq_key, sysrq_tty);
handle_sysrq(ctrlchar_sysrq_key);
}

static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq);
Expand Down Expand Up @@ -54,7 +53,6 @@ ctrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty)
/* racy */
if (len == 3 && buf[1] == '-') {
ctrlchar_sysrq_key = buf[2];
sysrq_tty = tty;
schedule_work(&ctrlchar_work);
return CTRLCHAR_SYSRQ;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
if (kbd->sysrq) {
if (kbd->sysrq == K(KT_LATIN, '-')) {
kbd->sysrq = 0;
handle_sysrq(value, kbd->tty);
handle_sysrq(value);
return;
}
if (value == '-') {
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/sn_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
sysrq_requested = 0;
if (ch && time_before(jiffies, sysrq_timeout)) {
spin_unlock_irqrestore(&port->sc_port.lock, flags);
handle_sysrq(ch, NULL);
handle_sysrq(ch);
spin_lock_irqsave(&port->sc_port.lock, flags);
/* ignore actual sysrq command char */
continue;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ int usb_serial_handle_sysrq_char(struct tty_struct *tty,
{
if (port->sysrq && port->port.console) {
if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, tty);
handle_sysrq(ch);
port->sysrq = 0;
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
goto again;

if (sysrq_key != '\0')
handle_sysrq(sysrq_key, NULL);
handle_sysrq(sysrq_key);
}

static struct xenbus_watch sysrq_watch = {
Expand Down
2 changes: 1 addition & 1 deletion include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
#ifdef SUPPORT_SYSRQ
if (port->sysrq) {
if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, port->state->port.tty);
handle_sysrq(ch);
port->sysrq = 0;
return 1;
}
Expand Down
12 changes: 5 additions & 7 deletions include/linux/sysrq.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#define _LINUX_SYSRQ_H

#include <linux/errno.h>

struct pt_regs;
struct tty_struct;
#include <linux/types.h>

/* Possible values of bitmask for enabling sysrq functions */
/* 0x0001 is reserved for enable everything */
Expand All @@ -44,8 +42,8 @@ struct sysrq_key_op {
* are available -- else NULL's).
*/

void handle_sysrq(int key, struct tty_struct *tty);
void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
void handle_sysrq(int key);
void __handle_sysrq(int key, bool check_mask);
int register_sysrq_key(int key, struct sysrq_key_op *op);
int unregister_sysrq_key(int key, struct sysrq_key_op *op);
struct sysrq_key_op *__sysrq_get_key_op(int key);
Expand All @@ -54,11 +52,11 @@ int sysrq_toggle_support(int enable_mask);

#else

static inline void handle_sysrq(int key, struct tty_struct *tty)
static inline void handle_sysrq(int key)
{
}

static inline void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
static inline void __handle_sysrq(int key, bool check_mask)
{
}

Expand Down
2 changes: 1 addition & 1 deletion kernel/debug/kdb/kdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ static int kdb_sr(int argc, const char **argv)
if (argc != 1)
return KDB_ARGCOUNT;
kdb_trap_printk++;
__handle_sysrq(*argv[1], NULL, 0);
__handle_sysrq(*argv[1], false);
kdb_trap_printk--;

return 0;
Expand Down

0 comments on commit f335397

Please sign in to comment.