[PATCH 2/2] mwifiex: simplify length computation for some memset

Subsystems: marvell mwifiex wireless driver, the rest

STALE3634d

2 messages, 2 authors, 2016-09-04 · open the first message on its own page

[PATCH 2/2] mwifiex: simplify length computation for some memset

From: Christophe JAILLET <hidden>
Date: 2016-08-08 07:39:10

This patch should be a no-op. It just simplifies code by using the name of
a variable instead of its type when calling 'sizeof'.

Signed-off-by: Christophe JAILLET <redacted>
---
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index 78819e8..644f3a2 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -574,7 +574,7 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
 
 	adapter->hs_activate_wait_q_woken = false;
 
-	memset(&hscfg, 0, sizeof(struct mwifiex_ds_hs_cfg));
+	memset(&hscfg, 0, sizeof(hscfg));
 	hscfg.is_invoke_hostcmd = true;
 
 	adapter->hs_enabling = true;
@@ -1138,7 +1138,7 @@ int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
 {
 	struct mwifiex_ds_encrypt_key encrypt_key;
 
-	memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
+	memset(&encrypt_key, 0, sizeof(encrypt_key));
 	encrypt_key.key_len = key_len;
 	encrypt_key.key_index = key_index;
 
-- 
2.7.4


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

Re: [PATCH 2/2] mwifiex: simplify length computation for some memset

From: Julian Calaby <hidden>
Date: 2016-09-04 03:25:11

Hi All,

On Mon, Aug 8, 2016 at 5:39 PM, Christophe JAILLET
[off-list ref] wrote:
This patch should be a no-op. It just simplifies code by using the name of
a variable instead of its type when calling 'sizeof'.

Signed-off-by: Christophe JAILLET <redacted>
Reviewed-by: Julian Calaby <redacted>

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help