All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mani Sadhasivam <manivannanece23@gmail.com>, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: rtl8712: Prefer ether_addr_copy
Date: Wed, 31 Aug 2016 10:34:18 -0700	[thread overview]
Message-ID: <1472664858.4176.15.camel@perches.com> (raw)
In-Reply-To: <20160831171829.GA19229@mani-Aspire-E5-573>

On Wed, 2016-08-31 at 22:48 +0530, Mani Sadhasivam wrote:
> This patch fixes the checkpatch.pl warning to prefer
> ether_addr_copy over memcpy

If you've verified that src & dst are _always_ __aligned(2),
(have you?, if so, please show that in the commit message)
then the other uses of memcmp and such should also be converted.

> diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
[]
> @@ -352,11 +352,11 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
>  			sta_addr = pattrib->src;
>  		}
>  	} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
> -		memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
> -		memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
> +		ether_addr_copy(pattrib->dst, GetAddr1Ptr(ptr));
> +		ether_addr_copy(pattrib->src, GetAddr2Ptr(ptr));
> +		ether_addr_copy(pattrib->bssid, GetAddr3Ptr(ptr));
> +		ether_addr_copy(pattrib->ra, pattrib->dst);
> +		ether_addr_copy(pattrib->ta, pattrib->src);

[etc...]

      reply	other threads:[~2016-08-31 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 17:18 [PATCH] Staging: rtl8712: Prefer ether_addr_copy Mani Sadhasivam
2016-08-31 17:34 ` Joe Perches [this message]

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=1472664858.4176.15.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannanece23@gmail.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.