public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Martin Kepplinger <martink@posteo.de>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, burzalodowa@gmail.com,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192u: initialize array in C compliant way
Date: Tue, 6 May 2014 11:47:49 +0300	[thread overview]
Message-ID: <20140506084749.GT26890@mwanda> (raw)
In-Reply-To: <1399364528-3727-1-git-send-email-martink@posteo.de>

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@posteo.de>
> ---
>  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


  reply	other threads:[~2014-05-06  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  8:22 [PATCH] staging: rtl8192u: initialize array in C compliant way Martin Kepplinger
2014-05-06  8:47 ` Dan Carpenter [this message]
2014-05-06 19:59   ` Christopher Li
2014-05-10  9:09   ` Christopher Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140506084749.GT26890@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=burzalodowa@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=martink@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox