Re: [PATCH 1/6] ath6kl: fix sparse warning on init.c

Kalle Valo
2011-12-20T20:02:37Z

On 12/20/2011 09:46 PM, Luis R. Rodriguez wrote:
> On Tue, Dec 20, 2011 at 09:40:19PM +0200, Kalle Valo wrote:

>> I always check for both compiler and sparse warnings and I have never
>> seen this. What version of compiler do you have?
>>
>> I have:
>>
>> gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
>
> Same.
>
> mcgrof@tux ~ $ gcc --version
> gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2

This is odd as I don't see it, even with latest wireless-testing:

$ make M=drivers/net/wireless/ath/ath6kl
LD drivers/net/wireless/ath/ath6kl/built-in.o
CC [M] drivers/net/wireless/ath/ath6kl/debug.o
CC [M] drivers/net/wireless/ath/ath6kl/hif.o
CC [M] drivers/net/wireless/ath/ath6kl/htc.o
CC [M] drivers/net/wireless/ath/ath6kl/bmi.o
CC [M] drivers/net/wireless/ath/ath6kl/cfg80211.o
CC [M] drivers/net/wireless/ath/ath6kl/init.o
CC [M] drivers/net/wireless/ath/ath6kl/main.o
CC [M] drivers/net/wireless/ath/ath6kl/txrx.o
CC [M] drivers/net/wireless/ath/ath6kl/wmi.o
CC [M] drivers/net/wireless/ath/ath6kl/sdio.o
CC [M] drivers/net/wireless/ath/ath6kl/testmode.o
CC [M] drivers/net/wireless/ath/ath6kl/usb.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_usb.o
Building modules, stage 2.
MODPOST 2 modules
CC drivers/net/wireless/ath/ath6kl/ath6kl_sdio.mod.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
CC drivers/net/wireless/ath/ath6kl/ath6kl_usb.mod.o
LD [M] drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko

I really would like to understand what's happening here...

But anyway, I think your test is not needed (unless I'm blind again).
Maybe uninitialized_var() is a better choise?

Kalle