Staging: ks7010: Replace memset with eth_zero_addr
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 16 Sep 2016 14:24:37 +0000 (19:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Sep 2016 21:32:13 +0000 (23:32 +0200)
commit30b48e2dbe7f4d78fb8f7abbef9851ec36a93dff
treea6c8f01c344b0605b748d0661980d52fef8e3a68
parentfaa48ea82bcd4b186dd548529d2514a9a2892095
Staging: ks7010: Replace memset with eth_zero_addr

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
Script:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/ks_wlan_net.c