Skip to content

Commit

Permalink
[PATCH] Char: isicom, fix tty index check
Browse files Browse the repository at this point in the history
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>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Dec 8, 2006
1 parent 11c8387 commit 17c4edf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/isicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,8 @@ static int isicom_open(struct tty_struct *tty, struct file *filp)
{
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)
Expand Down

0 comments on commit 17c4edf

Please sign in to comment.