From: Larry Finger <Larry.Finger@lwfinger.net>
To: Shraddha Barke <shraddha.6596@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Florian Schilhabel <florian.c.schilhabel@googlemail.com>,
Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>,
Julia Lawall <julia.lawall@lip6.fr>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] Staging: rtl8712: Replace memcpy by ether_addr_copy
Date: Sun, 6 Sep 2015 14:37:23 -0500 [thread overview]
Message-ID: <55EC95F3.5010309@lwfinger.net> (raw)
In-Reply-To: <1441566274-3992-1-git-send-email-shraddha.6596@gmail.com>
On 09/06/2015 02:04 PM, Shraddha Barke wrote:
> This patch replaces memcpy by ethr_addr_copy
>
> The change was made using Coccinelle
>
> @@ expression e1, e2; @@
> - memcpy(e1, e2, ETH_ALEN);
> + ether_addr_copy(e1, e2);
>
> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
> ---
> drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Your commit message has a typo.
More seriously, ether_addr_copy() requires that both arguments be u16 aligned.
This condition is not hard to meet, but I see no indication in your commit
message that you have checked this requirement. As a result, I must NACK this patch.
Coccinelle is a wonderful tool, but the user must exercise judgment when
applying the results.
Larry
Larry
>
> diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> index 77f01bf..76c1cfe 100644
> --- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> +++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> @@ -167,7 +167,7 @@ static int mp_start_test(struct _adapter *padapter)
> int res = _SUCCESS;
>
> /* 3 1. initialize a new struct wlan_bssid_ex */
> - memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
> + ether_addr_copy(bssid.MacAddress, pmppriv->network_macaddr);
> bssid.Ssid.SsidLength = 16;
> memcpy(bssid.Ssid.Ssid, (unsigned char *)"mp_pseudo_adhoc",
> bssid.Ssid.SsidLength);
>
prev parent reply other threads:[~2015-09-06 19:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-06 19:04 [PATCH 1/3] Staging: rtl8712: Replace memcpy by ether_addr_copy Shraddha Barke
2015-09-06 19:04 ` [PATCH 2/3] Staging: rtl8192e: Replace memcpy by ethr_addr_copy Shraddha Barke
2015-09-06 19:38 ` Larry Finger
2015-09-06 19:04 ` [PATCH 3/3] Staging: rtl8192u: r8192U_core.c: Replace memcpy with eth_addr_copy Shraddha Barke
2015-09-06 19:39 ` Larry Finger
2015-09-06 19:37 ` Larry Finger [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=55EC95F3.5010309@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mahfouz.saif.elyazal@gmail.com \
--cc=mateusz.kulikowski@gmail.com \
--cc=shraddha.6596@gmail.com \
--cc=sudipm.mukherjee@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.