Commit ca5c021c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] keyboard.c warning fix

drivers/char/keyboard.c: In function `k_fn':
drivers/char/keyboard.c:665: warning: comparison is always true due
to limited range of data type

I didn't want to just delete the code because one day the size of func_table
may get smaller, or the type of `value' may get larger.  When that happens,
the test becomes valid again.
parent 1c6e67fc
......@@ -660,9 +660,12 @@ static void k_cons(struct vc_data *vc, unsigned char value, char up_flag, struct
static void k_fn(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
{
unsigned v;
if (up_flag)
return;
if (value < ARRAY_SIZE(func_table)) {
v = value;
if (v < ARRAY_SIZE(func_table)) {
if (func_table[value])
puts_queue(vc, func_table[value]);
} else
......
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