mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1] Char: isicom, fix tty index check
Date: Tue, 31 Oct 2006 01:36:22 +0100 (CET)	[thread overview]
Message-ID: <1930913791828827916@karneval.cz> (raw)

isicom, fix tty index check

Since tty->index is signed and may be < 0, we should assign this to int not
uint. There is already a check to ensure if it is not negative, but
gcc complains with -W flag enabled and it is perfectly correct:
drivers/char/isicom.c:953: warning: comparison of unsigned expression < 0
is always false
Fix this issue by converting `line' variable from uint to int.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit d78c239943b72de4f541fcbe178569a78642110e
tree 6ab760f3466acc3f3ef941d18687315d9e75add2
parent d5f297a8d4df43d1d2a5f6146ed2f72a11832abe
author Jiri Slaby <jirislaby@gmail.com> Mon, 30 Oct 2006 14:29:32 +0100
committer Jiri Slaby <jirislaby@gmail.com> Mon, 30 Oct 2006 14:29:32 +0100

 drivers/char/isicom.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 9a61d0c..18a3a40 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -946,8 +946,8 @@ static int isicom_open(struct tty_struct
 {
 	struct isi_port *port;
 	struct isi_board *card;
-	unsigned int line, board;
-	int error;
+	unsigned int board;
+	int error, line;
 
 	line = tty->index;
 	if (line < 0 || line > PORT_COUNT-1)

                 reply	other threads:[~2006-10-31  0:36 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=1930913791828827916@karneval.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --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®