staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Tue, 3 Mar 2015 14:04:20 +0000 (16:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 17:54:34 +0000 (09:54 -0800)
commit76f73693ca36a13aff719c71236c47a4927c14a0
treeab97d3d56ad7b4218b2de4a241b59d1e2b79402b
parentcdbaf3f67279e7ee531c1be6da53731461a74237
staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

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

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_softmac_wx.c