* [patch] usb/serial/ssu100: uninitialized variable
@ 2010-08-13 12:38 Dan Carpenter
2010-08-13 12:58 ` Bill Pemberton
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-08-13 12:38 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Bill Pemberton, linux-usb, linux-kernel, kernel-janitors
GCC complains about the original code, because we're using an
unintialized variable "flag". I think we should be setting flag based
on the UART_LSR_BRK_ERROR_BITS but I'm not sure... I don't have this
hardware. Probably passing TTY_NORMAL is better than the current code?
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 6e82d4f..494998c 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -563,7 +563,6 @@ static int ssu100_process_packet(struct tty_struct *tty,
char *packet, int len)
{
int i;
- char flag;
char *ch;
dbg("%s - port %d", __func__, port->number);
@@ -597,10 +596,10 @@ static int ssu100_process_packet(struct tty_struct *tty,
if (port->port.console && port->sysrq) {
for (i = 0; i < len; i++, ch++) {
if (!usb_serial_handle_sysrq_char(tty, port, *ch))
- tty_insert_flip_char(tty, *ch, flag);
+ tty_insert_flip_char(tty, *ch, TTY_NORMAL);
}
} else
- tty_insert_flip_string_fixed_flag(tty, ch, flag, len);
+ tty_insert_flip_string_fixed_flag(tty, ch, TTY_NORMAL, len);
return len;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] usb/serial/ssu100: uninitialized variable
2010-08-13 12:38 [patch] usb/serial/ssu100: uninitialized variable Dan Carpenter
@ 2010-08-13 12:58 ` Bill Pemberton
0 siblings, 0 replies; 2+ messages in thread
From: Bill Pemberton @ 2010-08-13 12:58 UTC (permalink / raw)
To: Dan Carpenter
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, kernel-janitors
>
> GCC complains about the original code, because we're using an
> unintialized variable "flag". I think we should be setting flag based
> on the UART_LSR_BRK_ERROR_BITS but I'm not sure... I don't have this
> hardware. Probably passing TTY_NORMAL is better than the current code?
>
I took that function from ftdi_sio and stripped a lot out of it
while developing the driver. I see I missed adding back in the logic
dealing with setting flag correctly. I'll work up a patch to properly
deal with it.
--
Bill
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-13 13:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-13 12:38 [patch] usb/serial/ssu100: uninitialized variable Dan Carpenter
2010-08-13 12:58 ` Bill Pemberton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox