All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy
@ 2015-03-17 13:31 Ioana Ciornei
  2015-03-17 16:00 ` [Outreachy kernel] " Jes Sorensen
  2015-03-18  9:43 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Ioana Ciornei @ 2015-03-17 13:31 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ioana Ciornei

Replace memcpy() with ether_addr_copy() when using __aligned(2) Ethernet
addresses.
Changes done using the following coccinelle script:

@@
expression e1, e2;
@@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2); 

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
 drivers/staging/wlan-ng/prism2sta.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index 854571f..09fa76b 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1544,7 +1544,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
 	 ** authentication.
 	 */
 
-	memcpy(rec.address, inf->info.authreq.sta_addr, ETH_ALEN);
+	ether_addr_copy(rec.address, inf->info.authreq.sta_addr);
 	rec.status = P80211ENUM_status_unspec_failure;
 
 	/*
@@ -1657,8 +1657,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
 			if (hw->authlist.cnt >= WLAN_AUTH_MAX) {
 				rec.status = P80211ENUM_status_ap_full;
 			} else {
-				memcpy(hw->authlist.addr[hw->authlist.cnt],
-				       rec.address, ETH_ALEN);
+				ether_addr_copy(hw->authlist.addr[hw->authlist.cnt],
+						rec.address);
 				hw->authlist.cnt++;
 				added = 1;
 			}
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy
  2015-03-17 13:31 [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy Ioana Ciornei
@ 2015-03-17 16:00 ` Jes Sorensen
  2015-03-18  9:43 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2015-03-17 16:00 UTC (permalink / raw)
  To: Ioana Ciornei, outreachy-kernel

On 03/17/15 09:31, Ioana Ciornei wrote:
> Replace memcpy() with ether_addr_copy() when using __aligned(2) Ethernet
> addresses.
> Changes done using the following coccinelle script:
> 
> @@
> expression e1, e2;
> @@
> 
> - memcpy(e1, e2, ETH_ALEN);
> + ether_addr_copy(e1, e2); 
> 
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
>  drivers/staging/wlan-ng/prism2sta.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

This looks good to me!

Jes

> diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
> index 854571f..09fa76b 100644
> --- a/drivers/staging/wlan-ng/prism2sta.c
> +++ b/drivers/staging/wlan-ng/prism2sta.c
> @@ -1544,7 +1544,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
>  	 ** authentication.
>  	 */
>  
> -	memcpy(rec.address, inf->info.authreq.sta_addr, ETH_ALEN);
> +	ether_addr_copy(rec.address, inf->info.authreq.sta_addr);
>  	rec.status = P80211ENUM_status_unspec_failure;
>  
>  	/*
> @@ -1657,8 +1657,8 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev,
>  			if (hw->authlist.cnt >= WLAN_AUTH_MAX) {
>  				rec.status = P80211ENUM_status_ap_full;
>  			} else {
> -				memcpy(hw->authlist.addr[hw->authlist.cnt],
> -				       rec.address, ETH_ALEN);
> +				ether_addr_copy(hw->authlist.addr[hw->authlist.cnt],
> +						rec.address);
>  				hw->authlist.cnt++;
>  				added = 1;
>  			}
> 



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

* Re: [Outreachy kernel] [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy
  2015-03-17 13:31 [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy Ioana Ciornei
  2015-03-17 16:00 ` [Outreachy kernel] " Jes Sorensen
@ 2015-03-18  9:43 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2015-03-18  9:43 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: outreachy-kernel

On Tue, Mar 17, 2015 at 03:31:29PM +0200, Ioana Ciornei wrote:
> Replace memcpy() with ether_addr_copy() when using __aligned(2) Ethernet
> addresses.
> Changes done using the following coccinelle script:
> 
> @@
> expression e1, e2;
> @@
> 
> - memcpy(e1, e2, ETH_ALEN);
> + ether_addr_copy(e1, e2); 
> 
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
>  drivers/staging/wlan-ng/prism2sta.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

You need to "prove" that this type of change is acceptable before I can
take it, sorry.

thanks,

greg k-h


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

end of thread, other threads:[~2015-03-18  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 13:31 [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy Ioana Ciornei
2015-03-17 16:00 ` [Outreachy kernel] " Jes Sorensen
2015-03-18  9:43 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.