All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Ioana Ciornei <ciorneiioana@gmail.com>,
	 outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy
Date: Tue, 17 Mar 2015 12:00:12 -0400	[thread overview]
Message-ID: <55084F8C.4080102@gmail.com> (raw)
In-Reply-To: <1426599089-26954-1-git-send-email-ciorneiioana@gmail.com>

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;
>  			}
> 



  reply	other threads:[~2015-03-17 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 13:31 [PATCH] staging: prism2sta: Replace memcpy with ether_add_copy Ioana Ciornei
2015-03-17 16:00 ` Jes Sorensen [this message]
2015-03-18  9:43 ` [Outreachy kernel] " Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55084F8C.4080102@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=ciorneiioana@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.