linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: wilc1000: wilc_wfi_cfgoperations.c: replace memset(x,0,ETH_ALEN)
@ 2015-09-12  5:37 Shraddha Barke
  2015-09-12 15:48 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Shraddha Barke @ 2015-09-12  5:37 UTC (permalink / raw)
  To: Johnny Kim, Rachel Kim, Greg Kroah-Hartman, linux-wireless; +Cc: Shraddha Barke

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The aforementioned function replaces
memset.

Changes were done using Coccinelle

@eth_zero_addr@
expression e;
@@

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

Build tested it.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a6edc97..68482d95 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -575,7 +575,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 			 *  = SUCCESSFUL_STATUSCODE, while mac status is MAC_DISCONNECTED (which means something wrong happened) */
 			u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
 			linux_wlan_set_bssid(priv->dev, NullBssid);
-			memset(u8ConnectedSSID, 0, ETH_ALEN);
+			eth_zero_addr(u8ConnectedSSID);
 
 			/*BugID_5457*/
 			/*Invalidate u8WLANChannel value on wlan0 disconnect*/
@@ -641,9 +641,9 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 		u8P2Plocalrandom = 0x01;
 		u8P2Precvrandom = 0x00;
 		bWilc_ie = false;
-		memset(priv->au8AssociatedBss, 0, ETH_ALEN);
+		eth_zero_addr(priv->au8AssociatedBss);
 		linux_wlan_set_bssid(priv->dev, NullBssid);
-		memset(u8ConnectedSSID, 0, ETH_ALEN);
+		eth_zero_addr(u8ConnectedSSID);
 
 		/*BugID_5457*/
 		/*Invalidate u8WLANChannel value on wlan0 disconnect*/
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Staging: wilc1000: wilc_wfi_cfgoperations.c: replace memset(x,0,ETH_ALEN)
  2015-09-12  5:37 [PATCH] Staging: wilc1000: wilc_wfi_cfgoperations.c: replace memset(x,0,ETH_ALEN) Shraddha Barke
@ 2015-09-12 15:48 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-09-12 15:48 UTC (permalink / raw)
  To: Shraddha Barke; +Cc: Johnny Kim, Rachel Kim, linux-wireless

On Sat, Sep 12, 2015 at 11:07:39AM +0530, Shraddha Barke wrote:
> eth_zero_addr() is a wrapper function for memset if 0 is going to
> be assigned to a mac address. The aforementioned function replaces
> memset.
> 
> Changes were done using Coccinelle
> 
> @eth_zero_addr@
> expression e;
> @@
> 
> -memset(e,0x00,\(6\|ETH_ALEN\));
> +eth_zero_addr(e);
> 
> Build tested it.

You need to do much more to prove that this is a safe change than just
test build it, sorry.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-12 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-12  5:37 [PATCH] Staging: wilc1000: wilc_wfi_cfgoperations.c: replace memset(x,0,ETH_ALEN) Shraddha Barke
2015-09-12 15:48 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).