]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3a599f854fcd55ea464bed25cb260fd531e3fbf8
treea6c8f01c344b0605b748d0661980d52fef8e3a68
parent253612e5ec10a96dd4b9a7a9b64ac5b4817533d4
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