Skip to contentSkip to conversation

Staging: wilc1000: wilc_wfi_cfgoperations: Replace memset with eth_zero_addr

PATCH Superseded Shraddha Barke 2 participants 3 messages Oct 5, 2015 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: wilc1000: wilc_wfi_cfgoperations: Replace memset with eth_zero_addr

Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero.

The Coccinelle patch used -

// <smpl>
@eth_zero_addr@
expression e;
@@

-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);
// </smpl>

---
Changes in v2-
Dropped the second patch in series as it breaks the build.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +3 -3
index 04838f1..7cf39b29 100644
@@ -562,7 +562,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 			 *  = SUCCESSFUL_STATUSCODE, while mac status is MAC_DISCONNECTED (which means something wrong happened) */
 			u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
 			linux_wlan_set_bssid(priv->dev, NullBssid);
-			memset(u8ConnectedSSID, 0, ETH_ALEN);
+			eth_zero_addr(u8ConnectedSSID);
 
 			/*Invalidate u8WLANChannel value on wlan0 disconnect*/
 			if (!pstrWFIDrv->u8P2PConnect)
@@ -619,9 +619,9 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 		u8P2Plocalrandom = 0x01;
 		u8P2Precvrandom = 0x00;
 		bWilc_ie = false;
-		memset(priv->au8AssociatedBss, 0, ETH_ALEN);
+		eth_zero_addr(priv->au8AssociatedBss);
 		linux_wlan_set_bssid(priv->dev, NullBssid);
-		memset(u8ConnectedSSID, 0, ETH_ALEN);
+		eth_zero_addr(u8ConnectedSSID);
 
 		/*Invalidate u8WLANChannel value on wlan0 disconnect*/
 		if (!pstrWFIDrv->u8P2PConnect)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 14 lines · Shraddha Barke

Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero.

The Coccinelle patch used -

// <smpl>
@eth_zero_addr@
expression e;
@@

(quoted diff) +1 -1
-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);

// </smpl>

Quoted 4 lines

---
Changes in v2-
Dropped the second patch in series as it breaks the build.

Hi,

I am not sure why you dropped the second patch in series when you can solve the build errors by looking at errors more closely. Your change is correct. It just needs something more to be added.

Please send the whole series after solving the errors.

Quoted 37 lines
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +3 -4
index 04838f1..7cf39b29 100644
@@ -562,7 +562,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
                         *  = SUCCESSFUL_STATUSCODE, while mac status is MAC_DISCONNECTED (which means something wrong happened) */
                        u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
                        linux_wlan_set_bssid(priv->dev, NullBssid);
-                       memset(u8ConnectedSSID, 0, ETH_ALEN);
+                       eth_zero_addr(u8ConnectedSSID);
 
                        /*Invalidate u8WLANChannel value on wlan0 disconnect*/
                        if (!pstrWFIDrv->u8P2PConnect)
@@ -619,9 +619,9 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
                u8P2Plocalrandom = 0x01;
                u8P2Precvrandom = 0x00;
                bWilc_ie = false;
-               memset(priv->au8AssociatedBss, 0, ETH_ALEN);
+               eth_zero_addr(priv->au8AssociatedBss);
                linux_wlan_set_bssid(priv->dev, NullBssid);
-               memset(u8ConnectedSSID, 0, ETH_ALEN);
+               eth_zero_addr(u8ConnectedSSID);
 
                /*Invalidate u8WLANChannel value on wlan0 disconnect*/
                if (!pstrWFIDrv->u8P2PConnect)
--

2.1.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1444024004-6326-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Signature · 1 line
Vaishali
#2 lore raw
Quoted 22 lines · Vaishali Thakkar
Quoted 14 lines · Shraddha Barke

Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero.

The Coccinelle patch used -

// <smpl>
@eth_zero_addr@
expression e;
@@

(quoted diff) +1 -1
-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);

// </smpl>

Quoted 4 lines

---
Changes in v2-
Dropped the second patch in series as it breaks the build.

Hi,

Quoted 5 lines

I am not sure why you dropped the second patch in series when you can solve the build errors by looking at errors more closely. Your change is correct. It just needs something more to be added.

Please send the whole series after solving the errors.

Yeah sure. I'm sorry I thought the change was incorrect.

Quoted 44 lines
Quoted 38 lines
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +3 -4
index 04838f1..7cf39b29 100644
@@ -562,7 +562,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
                         *  = SUCCESSFUL_STATUSCODE, while mac status is MAC_DISCONNECTED (which means something wrong happened) */
                        u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
                        linux_wlan_set_bssid(priv->dev, NullBssid);
-                       memset(u8ConnectedSSID, 0, ETH_ALEN);
+                       eth_zero_addr(u8ConnectedSSID);
 
                        /*Invalidate u8WLANChannel value on wlan0 disconnect*/
                        if (!pstrWFIDrv->u8P2PConnect)
@@ -619,9 +619,9 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
                u8P2Plocalrandom = 0x01;
                u8P2Precvrandom = 0x00;
                bWilc_ie = false;
-               memset(priv->au8AssociatedBss, 0, ETH_ALEN);
+               eth_zero_addr(priv->au8AssociatedBss);
                linux_wlan_set_bssid(priv->dev, NullBssid);
-               memset(u8ConnectedSSID, 0, ETH_ALEN);
+               eth_zero_addr(u8ConnectedSSID);
 
                /*Invalidate u8WLANChannel value on wlan0 disconnect*/
                if (!pstrWFIDrv->u8P2PConnect)
--

2.1.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1444024004-6326-1-git-send-email-shraddha.6596%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Signature · 1 line
Vaishali