Staging: wilc1000: Replace memset with eth_zero_addr
authorVaishali Thakkar <vthakkar1994@gmail.com>
Sun, 21 Jun 2015 05:26:21 +0000 (10:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Jul 2015 02:23:35 +0000 (19:23 -0700)
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 semantic patch that makes this change is as follows:

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

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

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_mon.c

index f5296f5..2a3d875 100644 (file)
@@ -495,7 +495,7 @@ static void WILC_WFI_mon_setup(struct net_device *dev)
        ether_setup(dev);
        dev->tx_queue_len = 0;
        dev->type = ARPHRD_IEEE80211_RADIOTAP;
-       memset(dev->dev_addr, 0, ETH_ALEN);
+       eth_zero_addr(dev->dev_addr);
 
        #ifdef USE_WIRELESS
        {