提交 17c4edf0 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

[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: NJiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 11c83877
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册