Re: [PATCH] staging: rtl8192u: initialize array in C compliant way

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 06, 2014 at 10:22:08AM +0200, Martin Kepplinger wrote:
> Don't list elements to initialize. Remaining elements of a partly
> initialized array are set to zero. Sparse complained here.
> 
> Signed-off-by: Martin Kepplinger <martink@xxxxxxxxx>
> ---
>  drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> index 426f223..c96dbab 100644
> --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> @@ -241,7 +241,7 @@ static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee,
>  {
>  	//DIRECTION_VALUE	dir;
>  	u8	dir;
> -	bool				search_dir[4] = {0, 0, 0, 0};
> +	bool				search_dir[4] = {0};

That's weird.  The original code is valid but it generates a sparse
warning.

drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:244:58: warning: Initializer entry defined twice
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:244:61:   also defined here

It has something to do with "_Bool" types.  Changing it to "int" will
also make the warning disappear.  I've CC'd the sparse list to see if
anyone knows what's happening.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux