Commit 6f175817 authored by Jiri Slaby's avatar Jiri Slaby Committed by Kalle Valo

p54: memset(0) whole array

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: default avatarJiri 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: default avatarChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e1c122d5
...@@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell) ...@@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
entry += sizeof(__le16); entry += sizeof(__le16);
chan->pa_points_per_curve = 8; 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, memcpy(chan->curve_data, entry,
sizeof(struct p54_pa_curve_data_sample) * sizeof(struct p54_pa_curve_data_sample) *
min((u8)8, curve_data->points_per_channel)); min((u8)8, curve_data->points_per_channel));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment