[PATCH] Char: 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>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jiri Slaby 2006-12-08 02:38:57 -08:00 коммит произвёл Linus Torvalds
Родитель 11c838772d
Коммит 17c4edf0c8
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

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