Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: sysrq: rename and re-type i in sysrq_handle_loglevel()

'i' is a too generic name for something which carries a 'loglevel'. Name
it as such and make it 'u8', the same as key will become in the next
patches.

Note that we are not stripping any high bits away, 'key' is given only
8bit values.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230712081811.29004-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
00ef7eff 5bedcf70

+3 -4
+3 -4
drivers/tty/sysrq.c
··· 100 100 101 101 static void sysrq_handle_loglevel(int key) 102 102 { 103 - int i; 103 + u8 loglevel = key - '0'; 104 104 105 - i = key - '0'; 106 105 console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; 107 - pr_info("Loglevel set to %d\n", i); 108 - console_loglevel = i; 106 + pr_info("Loglevel set to %u\n", loglevel); 107 + console_loglevel = loglevel; 109 108 } 110 109 static const struct sysrq_key_op sysrq_loglevel_op = { 111 110 .handler = sysrq_handle_loglevel,