Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754597AbbFRXEO (ORCPT ); Thu, 18 Jun 2015 19:04:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59413 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752370AbbFRXEI (ORCPT ); Thu, 18 Jun 2015 19:04:08 -0400 Date: Thu, 18 Jun 2015 16:04:07 -0700 From: Greg KH To: Bilel DRIRA Cc: 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 Message-ID: <20150618230407.GD32238@kroah.com> References: <1434649791-4730-1-git-send-email-bilel.dr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434649791-4730-1-git-send-email-bilel.dr@gmail.com> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1551 Lines: 39 On Thu, Jun 18, 2015 at 06:49:51PM +0100, Bilel DRIRA wrote: > 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 > --- > 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)); 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 k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/