public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sysrq: allow user trigger sysrq by upper-case character key
@ 2013-03-06  4:07 zhangwei(Jovi)
  2013-03-06 19:31 ` Randy Dunlap
  2013-03-06 21:39 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: zhangwei(Jovi) @ 2013-03-06  4:07 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman, Jiri Slaby

See the help text output of /proc/sysrq-trigger:

   SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E)
   memory-full-oom-kill(F) kill-all-tasks(I) ...

Most command is referenced by responding upper-case character,
this would hint user can trigger sysrq by upper-case character key,
but that's wrong, sysrq only accept lower-case character currently.

It's reasonable to let user trigger sysrq by upper-case character key.

Signed-off-by: zhnagwei(Jovi) <jovi.zhangwei@huawei.com>
---
 drivers/tty/sysrq.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 3687f0c..a88908e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -471,6 +471,8 @@ static int sysrq_key_table_key2index(int key)
 		retval = key - '0';
 	else if ((key >= 'a') && (key <= 'z'))
 		retval = key + 10 - 'a';
+	else if ((key >= 'A') && (key <= 'Z'))
+		retval = key + 10 - 'A';
 	else
 		retval = -1;
 	return retval;
-- 
1.7.9.7



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-07  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06  4:07 [PATCH] sysrq: allow user trigger sysrq by upper-case character key zhangwei(Jovi)
2013-03-06 19:31 ` Randy Dunlap
2013-03-06 21:39 ` Andrew Morton
2013-03-07  8:40   ` zhangwei(Jovi)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox