From 76f73693ca36a13aff719c71236c47a4927c14a0 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Tue, 3 Mar 2015 16:04:20 +0200 Subject: [PATCH] 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 @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 + @special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @ @@ + + #include + @custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @ @@ + + #include Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 835f3d78a16f..283ba8b20128 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -120,7 +120,7 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee, ieee->state != RTLLIB_LINKED_SCANNING && ieee->wap_set == 0) - memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); + eth_zero_addr(wrqu->ap_addr.sa_data); else memcpy(wrqu->ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); -- 2.30.2