Commit f335397d authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: sysrq - drop tty argument form handle_sysrq()

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: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: default avatarJason Wessel <jason.wessel@windriver.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 1495cc9d
...@@ -149,7 +149,7 @@ static void receive_chars(struct tty_struct *tty) ...@@ -149,7 +149,7 @@ static void receive_chars(struct tty_struct *tty)
ch = ia64_ssc(0, 0, 0, 0, ch = ia64_ssc(0, 0, 0, 0,
SSC_GETCHAR); SSC_GETCHAR);
while (!ch); while (!ch);
handle_sysrq(ch, NULL); handle_sysrq(ch);
} }
#endif #endif
seen_esc = 0; seen_esc = 0;
......
...@@ -690,7 +690,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *), ...@@ -690,7 +690,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
static void sysrq_proc(void *arg) static void sysrq_proc(void *arg)
{ {
char *op = arg; char *op = arg;
handle_sysrq(*op, NULL); handle_sysrq(*op);
} }
void mconsole_sysrq(struct mc_request *req) void mconsole_sysrq(struct mc_request *req)
......
...@@ -159,7 +159,7 @@ static void hangcheck_fire(unsigned long data) ...@@ -159,7 +159,7 @@ static void hangcheck_fire(unsigned long data)
if (hangcheck_dump_tasks) { if (hangcheck_dump_tasks) {
printk(KERN_CRIT "Hangcheck: Task state:\n"); printk(KERN_CRIT "Hangcheck: Task state:\n");
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
handle_sysrq('t', NULL); handle_sysrq('t');
#endif /* CONFIG_MAGIC_SYSRQ */ #endif /* CONFIG_MAGIC_SYSRQ */
} }
if (hangcheck_reboot) { if (hangcheck_reboot) {
......
...@@ -651,7 +651,7 @@ int hvc_poll(struct hvc_struct *hp) ...@@ -651,7 +651,7 @@ int hvc_poll(struct hvc_struct *hp)
if (sysrq_pressed) if (sysrq_pressed)
continue; continue;
} else if (sysrq_pressed) { } else if (sysrq_pressed) {
handle_sysrq(buf[i], tty); handle_sysrq(buf[i]);
sysrq_pressed = 0; sysrq_pressed = 0;
continue; continue;
} }
......
...@@ -403,7 +403,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len) ...@@ -403,7 +403,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len)
hp->sysrq = 1; hp->sysrq = 1;
continue; continue;
} else if (hp->sysrq) { } else if (hp->sysrq) {
handle_sysrq(c, hp->tty); handle_sysrq(c);
hp->sysrq = 0; hp->sysrq = 0;
continue; continue;
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/tty.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
#include <linux/major.h> #include <linux/major.h>
...@@ -493,7 +492,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) ...@@ -493,7 +492,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
sysrq_key_table[i] = 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; struct sysrq_key_op *op_p;
int orig_log_level; int orig_log_level;
...@@ -545,10 +544,10 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) ...@@ -545,10 +544,10 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
spin_unlock_irqrestore(&sysrq_key_table_lock, flags); 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()) if (sysrq_on())
__handle_sysrq(key, tty, 1); __handle_sysrq(key, true);
} }
EXPORT_SYMBOL(handle_sysrq); EXPORT_SYMBOL(handle_sysrq);
...@@ -597,7 +596,7 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type, ...@@ -597,7 +596,7 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type,
default: default:
if (sysrq_down && value && value != 2) if (sysrq_down && value && value != 2)
__handle_sysrq(sysrq_xlate[code], NULL, 1); __handle_sysrq(sysrq_xlate[code], true);
break; break;
} }
...@@ -765,7 +764,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf, ...@@ -765,7 +764,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
if (get_user(c, buf)) if (get_user(c, buf))
return -EFAULT; return -EFAULT;
__handle_sysrq(c, NULL, 0); __handle_sysrq(c, false);
} }
return count; return count;
......
...@@ -16,12 +16,11 @@ ...@@ -16,12 +16,11 @@
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static int ctrlchar_sysrq_key; static int ctrlchar_sysrq_key;
static struct tty_struct *sysrq_tty;
static void static void
ctrlchar_handle_sysrq(struct work_struct *work) 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); static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq);
...@@ -54,7 +53,6 @@ ctrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty) ...@@ -54,7 +53,6 @@ ctrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty)
/* racy */ /* racy */
if (len == 3 && buf[1] == '-') { if (len == 3 && buf[1] == '-') {
ctrlchar_sysrq_key = buf[2]; ctrlchar_sysrq_key = buf[2];
sysrq_tty = tty;
schedule_work(&ctrlchar_work); schedule_work(&ctrlchar_work);
return CTRLCHAR_SYSRQ; return CTRLCHAR_SYSRQ;
} }
......
...@@ -305,7 +305,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode) ...@@ -305,7 +305,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
if (kbd->sysrq) { if (kbd->sysrq) {
if (kbd->sysrq == K(KT_LATIN, '-')) { if (kbd->sysrq == K(KT_LATIN, '-')) {
kbd->sysrq = 0; kbd->sysrq = 0;
handle_sysrq(value, kbd->tty); handle_sysrq(value);
return; return;
} }
if (value == '-') { if (value == '-') {
......
...@@ -492,7 +492,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags) ...@@ -492,7 +492,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
sysrq_requested = 0; sysrq_requested = 0;
if (ch && time_before(jiffies, sysrq_timeout)) { if (ch && time_before(jiffies, sysrq_timeout)) {
spin_unlock_irqrestore(&port->sc_port.lock, flags); spin_unlock_irqrestore(&port->sc_port.lock, flags);
handle_sysrq(ch, NULL); handle_sysrq(ch);
spin_lock_irqsave(&port->sc_port.lock, flags); spin_lock_irqsave(&port->sc_port.lock, flags);
/* ignore actual sysrq command char */ /* ignore actual sysrq command char */
continue; continue;
......
...@@ -453,7 +453,7 @@ int usb_serial_handle_sysrq_char(struct tty_struct *tty, ...@@ -453,7 +453,7 @@ int usb_serial_handle_sysrq_char(struct tty_struct *tty,
{ {
if (port->sysrq && port->port.console) { if (port->sysrq && port->port.console) {
if (ch && time_before(jiffies, port->sysrq)) { if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, tty); handle_sysrq(ch);
port->sysrq = 0; port->sysrq = 0;
return 1; return 1;
} }
......
...@@ -237,7 +237,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec, ...@@ -237,7 +237,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
goto again; goto again;
if (sysrq_key != '\0') if (sysrq_key != '\0')
handle_sysrq(sysrq_key, NULL); handle_sysrq(sysrq_key);
} }
static struct xenbus_watch sysrq_watch = { static struct xenbus_watch sysrq_watch = {
......
...@@ -465,7 +465,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) ...@@ -465,7 +465,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
#ifdef SUPPORT_SYSRQ #ifdef SUPPORT_SYSRQ
if (port->sysrq) { if (port->sysrq) {
if (ch && time_before(jiffies, port->sysrq)) { if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, port->state->port.tty); handle_sysrq(ch);
port->sysrq = 0; port->sysrq = 0;
return 1; return 1;
} }
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#define _LINUX_SYSRQ_H #define _LINUX_SYSRQ_H
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/types.h>
struct pt_regs;
struct tty_struct;
/* Possible values of bitmask for enabling sysrq functions */ /* Possible values of bitmask for enabling sysrq functions */
/* 0x0001 is reserved for enable everything */ /* 0x0001 is reserved for enable everything */
...@@ -44,8 +42,8 @@ struct sysrq_key_op { ...@@ -44,8 +42,8 @@ struct sysrq_key_op {
* are available -- else NULL's). * are available -- else NULL's).
*/ */
void handle_sysrq(int key, struct tty_struct *tty); void handle_sysrq(int key);
void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); void __handle_sysrq(int key, bool check_mask);
int register_sysrq_key(int key, struct sysrq_key_op *op); int register_sysrq_key(int key, struct sysrq_key_op *op);
int unregister_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); struct sysrq_key_op *__sysrq_get_key_op(int key);
...@@ -54,11 +52,11 @@ int sysrq_toggle_support(int enable_mask); ...@@ -54,11 +52,11 @@ int sysrq_toggle_support(int enable_mask);
#else #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)
{ {
} }
......
...@@ -1929,7 +1929,7 @@ static int kdb_sr(int argc, const char **argv) ...@@ -1929,7 +1929,7 @@ static int kdb_sr(int argc, const char **argv)
if (argc != 1) if (argc != 1)
return KDB_ARGCOUNT; return KDB_ARGCOUNT;
kdb_trap_printk++; kdb_trap_printk++;
__handle_sysrq(*argv[1], NULL, 0); __handle_sysrq(*argv[1], false);
kdb_trap_printk--; kdb_trap_printk--;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment