From: Joe Perches <joe@perches.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Bilel DRIRA <bilel.dr@gmail.com>,
eng.douglasfigueiredo@gmail.com, matt@ninezulu.com,
josh@joshtriplett.org, raghav3276@gmail.com,
tapaswenipathak@gmail.com, artemiyv@acm.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: wlan-ng: Fix memset warning found by sparse
Date: Thu, 18 Jun 2015 17:24:03 -0700 [thread overview]
Message-ID: <1434673443.2689.115.camel@perches.com> (raw)
In-Reply-To: <20150618230407.GD32238@kroah.com>
On Thu, 2015-06-18 at 16:04 -0700, Greg KH wrote:
> On Thu, Jun 18, 2015 at 06:49:51PM +0100, Bilel DRIRA wrote:
> > This patch fixes the following sparse warnings:
[]
> > diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
[]
> > @@ -245,10 +245,12 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
[]
> > - memset(s3data, 0, sizeof(s3data));
> > + for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
> > + memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
>
> You are doing the exact same thing here that the original code did, so
> why change it?
>
> That sparse warning is just a hint, I don't see anything wrong here with
> the original code, sorry.
Greg's right.
A possible improvement would be to malloc/free memory
as necessary instead of using large static buffers.
prev parent reply other threads:[~2015-06-19 0:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 17:49 [PATCH] staging: wlan-ng: Fix memset warning found by sparse Bilel DRIRA
2015-06-18 23:04 ` Greg KH
2015-06-19 0:24 ` Joe Perches [this message]
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=1434673443.2689.115.camel@perches.com \
--to=joe@perches.com \
--cc=artemiyv@acm.org \
--cc=bilel.dr@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=eng.douglasfigueiredo@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@ninezulu.com \
--cc=raghav3276@gmail.com \
--cc=tapaswenipathak@gmail.com \
/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