From: Bilel DRIRA <bilel.dr@gmail.com>
To: gregkh@linuxfoundation.org, eng.douglasfigueiredo@gmail.com,
matt@ninezulu.com, josh@joshtriplett.org, raghav3276@gmail.com,
tapaswenipathak@gmail.com, artemiyv@acm.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Bilel DRIRA <bilel.dr@gmail.com>
Subject: [PATCH] staging: wlan-ng: Fix memset warning found by sparse
Date: Thu, 18 Jun 2015 18:49:51 +0100 [thread overview]
Message-ID: <1434649791-4730-1-git-send-email-bilel.dr@gmail.com> (raw)
This patch fixes the following sparse warnings:
drivers/staging/wlan-ng/prism2fw.c:251:15: warning: memset with byte count of 120000
drivers/staging/wlan-ng/prism2fw.c:470:15: warning: memset with byte count of 120000
Signed-off-by: Bilel DRIRA <bilel.dr@gmail.com>
---
drivers/staging/wlan-ng/prism2fw.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index fe36613589ae..7652ca70da1b 100644
--- 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,
struct p80211msg_dot11req_mibget getmsg;
p80211itemd_t *item;
u32 *data;
+ unsigned int s3data_count = 0;
/* Initialize the data structures */
ns3data = 0;
- memset(s3data, 0, sizeof(s3data));
+ for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
+ memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
@@ -466,8 +468,10 @@ static void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks)
----------------------------------------------------------------*/
static void free_srecs(void)
{
+ unsigned int s3data_count = 0;
ns3data = 0;
- memset(s3data, 0, sizeof(s3data));
+ for (s3data_count = 0; s3data_count < S3DATA_MAX; s3data_count++)
+ memset(&s3data[s3data_count], 0, sizeof(struct s3datarec));
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
--
1.7.9.5
next reply other threads:[~2015-06-18 17:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 17:49 Bilel DRIRA [this message]
2015-06-18 23:04 ` [PATCH] staging: wlan-ng: Fix memset warning found by sparse Greg KH
2015-06-19 0:24 ` Joe Perches
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=1434649791-4730-1-git-send-email-bilel.dr@gmail.com \
--to=bilel.dr@gmail.com \
--cc=artemiyv@acm.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.