mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.4.26] drivers/char/keyboard.c fix compiler warnings
Date: Sat, 15 May 2004 15:00:02 +0200	[thread overview]
Message-ID: <200405151500.02776.tglx@linutronix.de> (raw)

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)

-- 
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: tglx@linutronix.de

--- 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)


                 reply	other threads:[~2004-05-15 13:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200405151500.02776.tglx@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®