From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752673AbbIFThb (ORCPT ); Sun, 6 Sep 2015 15:37:31 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:33447 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751695AbbIFTh0 (ORCPT ); Sun, 6 Sep 2015 15:37:26 -0400 Subject: Re: [PATCH 1/3] Staging: rtl8712: Replace memcpy by ether_addr_copy To: Shraddha Barke , Greg Kroah-Hartman , Florian Schilhabel , Mateusz Kulikowski , Aya Mahfouz , Julia Lawall , Sudip Mukherjee , linux-kernel@vger.kernel.org References: <1441566274-3992-1-git-send-email-shraddha.6596@gmail.com> From: Larry Finger Message-ID: <55EC95F3.5010309@lwfinger.net> Date: Sun, 6 Sep 2015 14:37:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1441566274-3992-1-git-send-email-shraddha.6596@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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); >