Commit f335397d177c906256ee1bba28e8c49e8ec63817

Authored by Dmitry Torokhov
1 parent 1495cc9df4

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: 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>

Showing 14 changed files with 22 additions and 27 deletions Side-by-side Diff

arch/ia64/hp/sim/simserial.c
... ... @@ -149,7 +149,7 @@
149 149 ch = ia64_ssc(0, 0, 0, 0,
150 150 SSC_GETCHAR);
151 151 while (!ch);
152   - handle_sysrq(ch, NULL);
  152 + handle_sysrq(ch);
153 153 }
154 154 #endif
155 155 seen_esc = 0;
arch/um/drivers/mconsole_kern.c
... ... @@ -690,7 +690,7 @@
690 690 static void sysrq_proc(void *arg)
691 691 {
692 692 char *op = arg;
693   - handle_sysrq(*op, NULL);
  693 + handle_sysrq(*op);
694 694 }
695 695  
696 696 void mconsole_sysrq(struct mc_request *req)
drivers/char/hangcheck-timer.c
... ... @@ -159,7 +159,7 @@
159 159 if (hangcheck_dump_tasks) {
160 160 printk(KERN_CRIT "Hangcheck: Task state:\n");
161 161 #ifdef CONFIG_MAGIC_SYSRQ
162   - handle_sysrq('t', NULL);
  162 + handle_sysrq('t');
163 163 #endif /* CONFIG_MAGIC_SYSRQ */
164 164 }
165 165 if (hangcheck_reboot) {
drivers/char/hvc_console.c
... ... @@ -651,7 +651,7 @@
651 651 if (sysrq_pressed)
652 652 continue;
653 653 } else if (sysrq_pressed) {
654   - handle_sysrq(buf[i], tty);
  654 + handle_sysrq(buf[i]);
655 655 sysrq_pressed = 0;
656 656 continue;
657 657 }
... ... @@ -403,7 +403,7 @@
403 403 hp->sysrq = 1;
404 404 continue;
405 405 } else if (hp->sysrq) {
406   - handle_sysrq(c, hp->tty);
  406 + handle_sysrq(c);
407 407 hp->sysrq = 0;
408 408 continue;
409 409 }
drivers/char/sysrq.c
... ... @@ -18,7 +18,6 @@
18 18 #include <linux/interrupt.h>
19 19 #include <linux/mm.h>
20 20 #include <linux/fs.h>
21   -#include <linux/tty.h>
22 21 #include <linux/mount.h>
23 22 #include <linux/kdev_t.h>
24 23 #include <linux/major.h>
... ... @@ -493,7 +492,7 @@
493 492 sysrq_key_table[i] = op_p;
494 493 }
495 494  
496   -void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
  495 +void __handle_sysrq(int key, bool check_mask)
497 496 {
498 497 struct sysrq_key_op *op_p;
499 498 int orig_log_level;
500 499  
... ... @@ -545,10 +544,10 @@
545 544 spin_unlock_irqrestore(&sysrq_key_table_lock, flags);
546 545 }
547 546  
548   -void handle_sysrq(int key, struct tty_struct *tty)
  547 +void handle_sysrq(int key)
549 548 {
550 549 if (sysrq_on())
551   - __handle_sysrq(key, tty, 1);
  550 + __handle_sysrq(key, true);
552 551 }
553 552 EXPORT_SYMBOL(handle_sysrq);
554 553  
... ... @@ -597,7 +596,7 @@
597 596  
598 597 default:
599 598 if (sysrq_down && value && value != 2)
600   - __handle_sysrq(sysrq_xlate[code], NULL, 1);
  599 + __handle_sysrq(sysrq_xlate[code], true);
601 600 break;
602 601 }
603 602  
... ... @@ -765,7 +764,7 @@
765 764  
766 765 if (get_user(c, buf))
767 766 return -EFAULT;
768   - __handle_sysrq(c, NULL, 0);
  767 + __handle_sysrq(c, false);
769 768 }
770 769  
771 770 return count;
drivers/s390/char/ctrlchar.c
... ... @@ -16,12 +16,11 @@
16 16  
17 17 #ifdef CONFIG_MAGIC_SYSRQ
18 18 static int ctrlchar_sysrq_key;
19   -static struct tty_struct *sysrq_tty;
20 19  
21 20 static void
22 21 ctrlchar_handle_sysrq(struct work_struct *work)
23 22 {
24   - handle_sysrq(ctrlchar_sysrq_key, sysrq_tty);
  23 + handle_sysrq(ctrlchar_sysrq_key);
25 24 }
26 25  
27 26 static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq);
... ... @@ -54,7 +53,6 @@
54 53 /* racy */
55 54 if (len == 3 && buf[1] == '-') {
56 55 ctrlchar_sysrq_key = buf[2];
57   - sysrq_tty = tty;
58 56 schedule_work(&ctrlchar_work);
59 57 return CTRLCHAR_SYSRQ;
60 58 }
drivers/s390/char/keyboard.c
... ... @@ -305,7 +305,7 @@
305 305 if (kbd->sysrq) {
306 306 if (kbd->sysrq == K(KT_LATIN, '-')) {
307 307 kbd->sysrq = 0;
308   - handle_sysrq(value, kbd->tty);
  308 + handle_sysrq(value);
309 309 return;
310 310 }
311 311 if (value == '-') {
drivers/serial/sn_console.c
... ... @@ -492,7 +492,7 @@
492 492 sysrq_requested = 0;
493 493 if (ch && time_before(jiffies, sysrq_timeout)) {
494 494 spin_unlock_irqrestore(&port->sc_port.lock, flags);
495   - handle_sysrq(ch, NULL);
  495 + handle_sysrq(ch);
496 496 spin_lock_irqsave(&port->sc_port.lock, flags);
497 497 /* ignore actual sysrq command char */
498 498 continue;
drivers/usb/serial/generic.c
... ... @@ -453,7 +453,7 @@
453 453 {
454 454 if (port->sysrq && port->port.console) {
455 455 if (ch && time_before(jiffies, port->sysrq)) {
456   - handle_sysrq(ch, tty);
  456 + handle_sysrq(ch);
457 457 port->sysrq = 0;
458 458 return 1;
459 459 }
drivers/xen/manage.c
... ... @@ -237,7 +237,7 @@
237 237 goto again;
238 238  
239 239 if (sysrq_key != '\0')
240   - handle_sysrq(sysrq_key, NULL);
  240 + handle_sysrq(sysrq_key);
241 241 }
242 242  
243 243 static struct xenbus_watch sysrq_watch = {
include/linux/serial_core.h
... ... @@ -465,7 +465,7 @@
465 465 #ifdef SUPPORT_SYSRQ
466 466 if (port->sysrq) {
467 467 if (ch && time_before(jiffies, port->sysrq)) {
468   - handle_sysrq(ch, port->state->port.tty);
  468 + handle_sysrq(ch);
469 469 port->sysrq = 0;
470 470 return 1;
471 471 }
include/linux/sysrq.h
... ... @@ -15,10 +15,8 @@
15 15 #define _LINUX_SYSRQ_H
16 16  
17 17 #include <linux/errno.h>
  18 +#include <linux/types.h>
18 19  
19   -struct pt_regs;
20   -struct tty_struct;
21   -
22 20 /* Possible values of bitmask for enabling sysrq functions */
23 21 /* 0x0001 is reserved for enable everything */
24 22 #define SYSRQ_ENABLE_LOG 0x0002
... ... @@ -44,8 +42,8 @@
44 42 * are available -- else NULL's).
45 43 */
46 44  
47   -void handle_sysrq(int key, struct tty_struct *tty);
48   -void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
  45 +void handle_sysrq(int key);
  46 +void __handle_sysrq(int key, bool check_mask);
49 47 int register_sysrq_key(int key, struct sysrq_key_op *op);
50 48 int unregister_sysrq_key(int key, struct sysrq_key_op *op);
51 49 struct sysrq_key_op *__sysrq_get_key_op(int key);
52 50  
... ... @@ -54,11 +52,11 @@
54 52  
55 53 #else
56 54  
57   -static inline void handle_sysrq(int key, struct tty_struct *tty)
  55 +static inline void handle_sysrq(int key)
58 56 {
59 57 }
60 58  
61   -static inline void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
  59 +static inline void __handle_sysrq(int key, bool check_mask)
62 60 {
63 61 }
64 62  
kernel/debug/kdb/kdb_main.c
... ... @@ -1929,7 +1929,7 @@
1929 1929 if (argc != 1)
1930 1930 return KDB_ARGCOUNT;
1931 1931 kdb_trap_printk++;
1932   - __handle_sysrq(*argv[1], NULL, 0);
  1932 + __handle_sysrq(*argv[1], false);
1933 1933 kdb_trap_printk--;
1934 1934  
1935 1935 return 0;