public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 8250: Fix compiler warning
@ 2011-08-04  8:13 Kumar Gala
  2011-08-04 18:45 ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2011-08-04  8:13 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

drivers/tty/serial/8250.c: In function 'serial8250_shutdown':
drivers/tty/serial/8250.c:1775:19: warning: 'i' may be used uninitialized in this function

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 drivers/tty/serial/8250.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index f2dfec8..44de222 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1772,7 +1772,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
 
 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;
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250: Fix compiler warning
  2011-08-04  8:13 [PATCH] 8250: Fix compiler warning Kumar Gala
@ 2011-08-04 18:45 ` Alan Cox
  2011-08-10 14:01   ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2011-08-04 18:45 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Greg KH, linux-kernel

On Thu,  4 Aug 2011 03:13:01 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> drivers/tty/serial/8250.c: In function 'serial8250_shutdown':
> drivers/tty/serial/8250.c:1775:19: warning: 'i' may be used uninitialized in this function

NAK, as with all the previous nacks of this.

Use a newer gcc - modern gcc gets it right.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250: Fix compiler warning
  2011-08-04 18:45 ` Alan Cox
@ 2011-08-10 14:01   ` Kumar Gala
  2011-08-10 14:24     ` Maxin B John
  2011-08-10 15:11     ` Alan Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Kumar Gala @ 2011-08-10 14:01 UTC (permalink / raw)
  To: Alan Cox; +Cc: Greg KH, linux-kernel


On Aug 4, 2011, at 1:45 PM, Alan Cox wrote:

> On Thu,  4 Aug 2011 03:13:01 -0500
> Kumar Gala <galak@kernel.crashing.org> wrote:
> 
>> drivers/tty/serial/8250.c: In function 'serial8250_shutdown':
>> drivers/tty/serial/8250.c:1775:19: warning: 'i' may be used uninitialized in this function
> 
> NAK, as with all the previous nacks of this.
> 
> Use a newer gcc - modern gcc gets it right.

How modern? Building with a gcc 4.5.x

- k

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250: Fix compiler warning
  2011-08-10 14:01   ` Kumar Gala
@ 2011-08-10 14:24     ` Maxin B John
  2011-08-10 15:11     ` Alan Cox
  1 sibling, 0 replies; 5+ messages in thread
From: Maxin B John @ 2011-08-10 14:24 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Alan Cox, Greg KH, linux-kernel

Hi Alan,

On Wed, Aug 10, 2011 at 5:01 PM, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Aug 4, 2011, at 1:45 PM, Alan Cox wrote:
>
>> On Thu,  4 Aug 2011 03:13:01 -0500
>> Kumar Gala <galak@kernel.crashing.org> wrote:
>>
>>> drivers/tty/serial/8250.c: In function 'serial8250_shutdown':
>>> drivers/tty/serial/8250.c:1775:19: warning: 'i' may be used uninitialized in this function
>>
>> NAK, as with all the previous nacks of this.
>>
>> Use a newer gcc - modern gcc gets it right.

Can we use "uninitialized_var(x)" present in "linux/compiler-gcc.h"
in this scenario ?
ie:
struct irq_info *uninitialized_var(i);

Warm Regards,
Maxin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250: Fix compiler warning
  2011-08-10 14:01   ` Kumar Gala
  2011-08-10 14:24     ` Maxin B John
@ 2011-08-10 15:11     ` Alan Cox
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Cox @ 2011-08-10 15:11 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Greg KH, linux-kernel

> > Use a newer gcc - modern gcc gets it right.
> 
> How modern? Building with a gcc 4.5.x

4.5.x gets this right on x86 and I don't want to risk hiding a future bug
in that area of code with some mindless initialiser hacks.

(OTOH if you can figure a way to restructure that code a bit so its tidy,
clear and the compiler gets it right too ...)

Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-10 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04  8:13 [PATCH] 8250: Fix compiler warning Kumar Gala
2011-08-04 18:45 ` Alan Cox
2011-08-10 14:01   ` Kumar Gala
2011-08-10 14:24     ` Maxin B John
2011-08-10 15:11     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox