Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33606 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbcJOGEz (ORCPT ); Sat, 15 Oct 2016 02:04:55 -0400 From: Christian Lamparter To: Jiri Slaby , linux-kernel@vger.kernel.org Cc: Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] p54: memset(0) whole array Date: Sat, 15 Oct 2016 08:04:51 +0200 Message-ID: <6511335.zy53ITykIM@debian64> (sfid-20161015_080546_609689_69F06D37) In-Reply-To: <20161014092309.24113-1-jslaby@suse.cz> References: <20161014092309.24113-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-wireless-owner@vger.kernel.org List-ID: On Friday, October 14, 2016 11:23:09 AM CEST Jiri Slaby wrote: > gcc 7 complains: > drivers/net/wireless/intersil/p54/fwio.c: In function 'p54_scan': > drivers/net/wireless/intersil/p54/fwio.c:491:4: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] > > Fix that by passing the correct size to memset. > > Signed-off-by: Jiri Slaby > Cc: Christian Lamparter > Cc: Kalle Valo > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org Acked-by: Christian Lamparter > --- > drivers/net/wireless/intersil/p54/fwio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/intersil/p54/fwio.c b/drivers/net/wireless/intersil/p54/fwio.c > index 257a9eadd595..4ac6764f4897 100644 > --- a/drivers/net/wireless/intersil/p54/fwio.c > +++ b/drivers/net/wireless/intersil/p54/fwio.c > @@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell) > > entry += sizeof(__le16); > chan->pa_points_per_curve = 8; > - memset(chan->curve_data, 0, sizeof(*chan->curve_data)); > + memset(chan->curve_data, 0, sizeof(chan->curve_data)); > memcpy(chan->curve_data, entry, > sizeof(struct p54_pa_curve_data_sample) * > min((u8)8, curve_data->points_per_channel)); >