]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8723bs: Replace memset with eth_zero_addr
authorArushi Singhal <arushisinghal19971997@gmail.com>
Sat, 3 Mar 2018 21:11:42 +0000 (02:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Mar 2018 12:07:48 +0000 (04:07 -0800)
commit64a53d2660e40afdda178f56407ef0a3cf8dea47
tree005b29e2f6852b000debfd32eabe0ca048072c8e
parentcc18baf7fff451b07d1ed9d9e6786f419996ab60
staging: rtl8723bs: 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.

The Coccinelle semantic patch that makes this change is as follows:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

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

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

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme.c
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c