netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] p54: memset(0) whole array
@ 2016-10-14  9:23 Jiri Slaby
  2016-10-15  6:04 ` Christian Lamparter
       [not found] ` <20161014092309.24113-1-jslaby-AlSwsSmVLrQ@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2016-10-14  9:23 UTC (permalink / raw)
  To: chunkeey; +Cc: linux-kernel, Jiri Slaby, Kalle Valo, linux-wireless, netdev

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 <jslaby@suse.cz>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
---
 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));
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] p54: memset(0) whole array
  2016-10-14  9:23 [PATCH] p54: memset(0) whole array Jiri Slaby
@ 2016-10-15  6:04 ` Christian Lamparter
       [not found] ` <20161014092309.24113-1-jslaby-AlSwsSmVLrQ@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Lamparter @ 2016-10-15  6:04 UTC (permalink / raw)
  To: Jiri Slaby, linux-kernel; +Cc: Kalle Valo, linux-wireless, netdev

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 <jslaby@suse.cz>
> Cc: Christian Lamparter <chunkeey@googlemail.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
> ---
>  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));
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: p54: memset(0) whole array
       [not found] ` <20161014092309.24113-1-jslaby-AlSwsSmVLrQ@public.gmane.org>
@ 2016-11-17  6:45   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2016-11-17  6:45 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: chunkeey-gM/Ye1E23mwN+BqQ9rBEUg,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jiri Slaby,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org> 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 <jslaby-AlSwsSmVLrQ@public.gmane.org>
> Cc: Christian Lamparter <chunkeey-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> Cc: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Acked-by: Christian Lamparter <chunkeey-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

Patch applied to wireless-drivers-next.git, thanks.

6f1758178820 p54: memset(0) whole array

-- 
https://patchwork.kernel.org/patch/9376333/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-17  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14  9:23 [PATCH] p54: memset(0) whole array Jiri Slaby
2016-10-15  6:04 ` Christian Lamparter
     [not found] ` <20161014092309.24113-1-jslaby-AlSwsSmVLrQ@public.gmane.org>
2016-11-17  6:45   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).