Skip to contentSkip to conversation

Char: isicom, fix tty index check

PATCH New Jiri Slaby 1 participant 1 message Oct 31, 2006 Char and misc drivers

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 Char: isicom, fix tty index check

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.

---
commit d78c239943b72de4f541fcbe178569a78642110e
tree 6ab760f3466acc3f3ef941d18687315d9e75add2
parent d5f297a8d4df43d1d2a5f6146ed2f72a11832abe
author Jiri Slaby <[email protected]> Mon, 30 Oct 2006 14:29:32 +0100 committer Jiri Slaby <[email protected]> Mon, 30 Oct 2006 14:29:32 +0100

 drivers/char/isicom.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/isicom.c +2 -2
index 9a61d0c..18a3a40 100644
@@ -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)