Skip to contentSkip to conversation

drivers/char/keyboard.c fix compiler warnings

PATCH New Thomas Gleixner 1 participant 1 message May 15, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/char/keyboard.c fix compiler warnings

The patch fixes the following warnings, produced by gcc3.3.3:

keyboard.c: In function `do_fn':
keyboard.c:640: warning: comparison is always true due to limited range of data type

SIZE(func_table) is 256. So value can't be >= SIZE(func_table)

Signature · 26 lines
Thomas
________________________________________________________________________
"Free software" is a matter of liberty, not price. To understand the concept,
you should think of "free" as in "free speech,'' not as in "free beer".
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: [email protected]

--- linux-2.4.26.org/drivers/char/keyboard.c	2003-11-28 19:26:20.000000000 
+0100
+++ linux-2.4.26/drivers/char/keyboard.c	2004-05-15 13:35:19.000000000 +0200
@@ -637,11 +637,8 @@
 {
 	if (up_flag)
 		return;
-	if (value < SIZE(func_table)) {
-		if (func_table[value])
-			puts_queue(func_table[value]);
-	} else
-		printk(KERN_ERR "do_fn called with value=%d\n", value);
+	if (func_table[value])
+		puts_queue(func_table[value]);
 }
 
 static void do_pad(unsigned char value, char up_flag)