* [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c
@ 2009-02-02 9:10 Wenji Huang
2009-02-02 10:03 ` Laurent Pinchart
2009-02-03 17:22 ` Alan Cox
0 siblings, 2 replies; 4+ messages in thread
From: Wenji Huang @ 2009-02-02 9:10 UTC (permalink / raw)
To: linux-serial; +Cc: lkml
This patch is to remove the the warning of uninitialized i in
driver/serial/8250.c
Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
diff -Nurh drivers/serial/8250.c.Orig drivers/serial/8250.c
--- drivers/serial/8250.c.Orig 2009-02-02 14:02:47.000000000 -0500
+++ drivers/serial/8250.c 2009-02-02 14:03:30.000000000 -0500
@@ -1678,7 +1678,7 @@
static void serial_unlink_irq_chain(struct uart_8250_port *up)
{
- struct irq_info *i;
+ struct irq_info *i = NULL;
struct hlist_node *n;
struct hlist_head *h;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c
2009-02-02 9:10 [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c Wenji Huang
@ 2009-02-02 10:03 ` Laurent Pinchart
2009-02-03 17:21 ` Alan Cox
2009-02-03 17:22 ` Alan Cox
1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2009-02-02 10:03 UTC (permalink / raw)
To: wenji.huang; +Cc: linux-serial, lkml
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
On Monday 02 February 2009 10:10:06 Wenji Huang wrote:
> This patch is to remove the the warning of uninitialized i in
> driver/serial/8250.c
>
> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
>
> diff -Nurh drivers/serial/8250.c.Orig drivers/serial/8250.c
> --- drivers/serial/8250.c.Orig 2009-02-02 14:02:47.000000000 -0500
> +++ drivers/serial/8250.c 2009-02-02 14:03:30.000000000 -0500
> @@ -1678,7 +1678,7 @@
>
> static void serial_unlink_irq_chain(struct uart_8250_port *up)
> {
> - struct irq_info *i;
> + struct irq_info *i = NULL;
> struct hlist_node *n;
> struct hlist_head *h;
gcc is wrong, i can't be used uninitialized in that function. You should use
the following construct instead to suppress the warning without generating any
code.
struct irq_info *uninitialized_var(i);
Best regards,
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c
2009-02-02 9:10 [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c Wenji Huang
2009-02-02 10:03 ` Laurent Pinchart
@ 2009-02-03 17:22 ` Alan Cox
1 sibling, 0 replies; 4+ messages in thread
From: Alan Cox @ 2009-02-03 17:22 UTC (permalink / raw)
To: wenji.huang; +Cc: linux-serial, lkml
On Mon, 02 Feb 2009 17:10:06 +0800
Wenji Huang <wenji.huang@oracle.com> wrote:
> This patch is to remove the the warning of uninitialized i in
> driver/serial/8250.c
>
> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
NAK - your gcc is wrong. Use a newer gcc and the warning goes away.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-03 17:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-02 9:10 [PATCH] Fix the warning of uninitialized value in driver/serial/8250.c Wenji Huang
2009-02-02 10:03 ` Laurent Pinchart
2009-02-03 17:21 ` Alan Cox
2009-02-03 17:22 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox