Staging: wilc1000: wilc_wfi_cfgoperations: Replace memset with eth_zero_addr
authorShraddha Barke <shraddha.6596@gmail.com>
Mon, 5 Oct 2015 11:30:32 +0000 (17:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Oct 2015 09:59:17 +0000 (10:59 +0100)
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>

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index 2f67546f3facef0ec8cf81a81a80a101a39c5d87..64727774235be178dacdc497b977e7a08a1efd05 100644 (file)
@@ -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)