Skip to contentSkip to conversation

hv{c,cs,si}_struct make *count signed

PATCH New Roel Kluin 1 participant 1 message Dec 2, 2008 Char and misc drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH v2 1/1 hv{c,cs,si}_struct make *count signed

Otherwise count < 0 will fail

---
This was not tested. Is this how it should be fixed?

the locations where the failures occur are in the functions hv*_close, on:

vi drivers/char/hvcs.c +1251

vi drivers/char/hvsi.c +911

vi drivers/char/drivers/char/hvc_console.c +387

drivers/char/hvc_console.h +1 -1
index 8297dbc..3c85d78 100644
@@ -48,7 +48,7 @@ struct hvc_struct {
 	spinlock_t lock;
 	int index;
 	struct tty_struct *tty;
-	unsigned int count;
+	int count;
 	int do_wakeup;
 	char *outbuf;
 	int outbuf_size;
drivers/char/hvcs.c +1 -1
index 473d9b1..6e6eb44 100644
@@ -269,7 +269,7 @@ struct hvcs_struct {
 	unsigned int index;
 
 	struct tty_struct *tty;
-	unsigned int open_count;
+	int open_count;
 
 	/*
 	 * Used to tell the driver kernel_thread what operations need to take
drivers/char/hvsi.c +1 -1
index 59c6f9a..af05528 100644
@@ -75,7 +75,7 @@ struct hvsi_struct {
 	spinlock_t lock;
 	int index;
 	struct tty_struct *tty;
-	unsigned int count;
+	int count;
 	uint8_t throttle_buf[128];
 	uint8_t outbuf[N_OUTBUF]; /* to implement write_room and chars_in_buffer */
 	/* inbuf is for packet reassembly. leave a little room for leftovers. */