linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: fix two warnings
@ 2009-12-02 10:20 Johannes Berg
  2009-12-02 12:42 ` Michael Buesch
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2009-12-02 10:20 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

My gcc appears to be able to see past the function
boundary and notices that the variable 'behaviour'
could be used uninitialised:

drivers/net/wireless/b43/leds.c: In function ‘b43_leds_register’:
drivers/net/wireless/b43/leds.c:339: warning: ‘behaviour’ may be used uninitialized in this function
drivers/net/wireless/b43/leds.c: In function ‘b43_leds_init’:
drivers/net/wireless/b43/leds.c:262: warning: ‘behaviour’ may be used uninitialized in this function

because b43_led_get_sprominfo() didn't initialise
it in all cases.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/b43/leds.c |    1 +
 1 file changed, 1 insertion(+)

--- wireless-testing.orig/drivers/net/wireless/b43/leds.c	2009-12-02 11:15:53.000000000 +0100
+++ wireless-testing/drivers/net/wireless/b43/leds.c	2009-12-02 11:16:26.000000000 +0100
@@ -246,6 +246,7 @@ static void b43_led_get_sprominfo(struct
 			*behaviour = B43_LED_OFF;
 			break;
 		default:
+			*behaviour = B43_LED_OFF;
 			B43_WARN_ON(1);
 			return;
 		}



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

* Re: [PATCH] b43: fix two warnings
  2009-12-02 10:20 [PATCH] b43: fix two warnings Johannes Berg
@ 2009-12-02 12:42 ` Michael Buesch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2009-12-02 12:42 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

On Wednesday 02 December 2009 11:20:36 Johannes Berg wrote:
> My gcc appears to be able to see past the function
> boundary and notices that the variable 'behaviour'
> could be used uninitialised:
> 
> drivers/net/wireless/b43/leds.c: In function ‘b43_leds_register’:
> drivers/net/wireless/b43/leds.c:339: warning: ‘behaviour’ may be used uninitialized in this function
> drivers/net/wireless/b43/leds.c: In function ‘b43_leds_init’:
> drivers/net/wireless/b43/leds.c:262: warning: ‘behaviour’ may be used uninitialized in this function
> 
> because b43_led_get_sprominfo() didn't initialise
> it in all cases.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

ack


-- 
Greetings, Michael.

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

end of thread, other threads:[~2009-12-02 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 10:20 [PATCH] b43: fix two warnings Johannes Berg
2009-12-02 12:42 ` Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).