Skip to contentSkip to conversation

serial: ifx6x60: add missing variable initialization

PATCH In review Jingoo Han 2 participants 3 messages Feb 27, 2013 TTY layer and serial drivers

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 serial: ifx6x60: add missing variable initialization

Fixed build warning as below:

drivers/tty/serial/ifx6x60.c:753:8: warning: 'more' may be used uninitialized in this function [-Wuninitialized]

---
 drivers/tty/serial/ifx6x60.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/tty/serial/ifx6x60.c +1 -1
index 68d7ce9..3d78baf 100644
@@ -687,7 +687,7 @@ static void ifx_spi_complete(void *ctx)
 	struct tty_ldisc *ldisc = NULL;
 	int length;
 	int actual_length;
-	unsigned char more;
+	unsigned char more = 0;
 	unsigned char cts;
 	int local_write_pending = 0;
 	int queue_length;
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 3 lines · Jingoo Han

Fixed build warning as below:

drivers/tty/serial/ifx6x60.c:753:8: warning: 'more' may be used uninitialized in this function [-Wuninitialized]

This needs some more investigation and explanation than that. Are you fixing a real compiler warning or hiding a bug here?

Quoted 19 lines
---
 drivers/tty/serial/ifx6x60.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/tty/serial/ifx6x60.c +1 -1
index 68d7ce9..3d78baf 100644
@@ -687,7 +687,7 @@ static void ifx_spi_complete(void *ctx)
 	struct tty_ldisc *ldisc = NULL;
 	int length;
 	int actual_length;
-	unsigned char more;
+	unsigned char more = 0;
 	unsigned char cts;
 	int local_write_pending = 0;
 	int queue_length;
Signature · 2 lines
js
suse labs
author
#2 lore raw
Quoted 9 lines · Jiri Slaby
Quoted 3 lines · Jingoo Han

Fixed build warning as below:

drivers/tty/serial/ifx6x60.c:753:8: warning: 'more' may be used uninitialized in this function [-

Wuninitialized]

This needs some more investigation and explanation than that. Are you fixing a real compiler warning or hiding a bug here?

Sorry, I don't have the deep knowledge about ifx6x60. I just want to remove build warning.

Maybe, Chen Jun or other guy will resolve this warning properly.

Please, abandon this patch.

Quoted 25 lines
Quoted 12 lines
---
 drivers/tty/serial/ifx6x60.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/tty/serial/ifx6x60.c +0 -0
index 68d7ce9..3d78baf 100644

drivers/tty/serial/ifx6x60.c static void ifx_spi_complete(void *ctx) · line 693

Quoted 8 lines
drivers/tty/serial/ifx6x60.c +1 -1
@@ -687,7 +687,7 @@ static void ifx_spi_complete(void *ctx)
 	struct tty_ldisc *ldisc = NULL;
 	int length;
 	int actual_length;
-	unsigned char more;
+	unsigned char more = 0;
 	unsigned char cts;
 	int local_write_pending = 0;
 	int queue_length;

--
js
suse labs