aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt/keyboard.c
diff options
context:
space:
mode:
authorAndreas Platschek <andi.platschek@gmail.com>2013-07-26 00:46:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-26 19:19:48 -0400
commitcf940ebe98e693aec2d10f9af2fb84eb55234e3c (patch)
tree988fddbce4712cdd7425fb1c6fba802f8b34be3f /drivers/tty/vt/keyboard.c
parent17fae28efe8f460918e13aedd7163690206c682d (diff)
tty: Remove dead code
-> The ledptrs[] array is never initialized. -> There is no place where kbd->ledmode is set to LED_SHOW_MEM therefore the if statement does not make much sense. -> Since LED_SHOW_MEM is not used, it can be removed from the header file as well. Signed-off-by: Andreas Platschek <andi.platschek@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/keyboard.c')
-rw-r--r--drivers/tty/vt/keyboard.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index a9af1b9ae160..d0e3a4497707 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -132,12 +132,6 @@ static int shift_state = 0;
132static unsigned char ledstate = 0xff; /* undefined */ 132static unsigned char ledstate = 0xff; /* undefined */
133static unsigned char ledioctl; 133static unsigned char ledioctl;
134 134
135static struct ledptr {
136 unsigned int *addr;
137 unsigned int mask;
138 unsigned char valid:1;
139} ledptrs[3];
140
141/* 135/*
142 * Notifier list for console keyboard events 136 * Notifier list for console keyboard events
143 */ 137 */
@@ -994,24 +988,11 @@ void setledstate(struct kbd_struct *kbd, unsigned int led)
994static inline unsigned char getleds(void) 988static inline unsigned char getleds(void)
995{ 989{
996 struct kbd_struct *kbd = kbd_table + fg_console; 990 struct kbd_struct *kbd = kbd_table + fg_console;
997 unsigned char leds;
998 int i;
999 991
1000 if (kbd->ledmode == LED_SHOW_IOCTL) 992 if (kbd->ledmode == LED_SHOW_IOCTL)
1001 return ledioctl; 993 return ledioctl;
1002 994
1003 leds = kbd->ledflagstate; 995 return kbd->ledflagstate;
1004
1005 if (kbd->ledmode == LED_SHOW_MEM) {
1006 for (i = 0; i < 3; i++)
1007 if (ledptrs[i].valid) {
1008 if (*ledptrs[i].addr & ledptrs[i].mask)
1009 leds |= (1 << i);
1010 else
1011 leds &= ~(1 << i);
1012 }
1013 }
1014 return leds;
1015} 996}
1016 997
1017static int kbd_update_leds_helper(struct input_handle *handle, void *data) 998static int kbd_update_leds_helper(struct input_handle *handle, void *data)