Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbbETSlu (ORCPT ); Wed, 20 May 2015 14:41:50 -0400 Received: from s159.web-hosting.com ([68.65.121.203]:50716 "EHLO s159.web-hosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbbETSls (ORCPT ); Wed, 20 May 2015 14:41:48 -0400 MIME-Version: 1.0 In-Reply-To: <1431966765-10259-1-git-send-email-jteki@openedev.com> References: <1431966765-10259-1-git-send-email-jteki@openedev.com> Date: Thu, 21 May 2015 00:11:46 +0530 Message-ID: Subject: Re: [PATCH v3] staging: rtl8712: Use ether_addr_copy() instead of memcpy() From: Jagan Teki To: "linux-kernel@vger.kernel.org" Cc: devel@driverdev.osuosl.org, Florian Schilhabel , Greg Kroah-Hartman , Dan Carpenter , Larry Finger Content-Type: text/plain; charset=UTF-8 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server159.web-hosting.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - openedev.com X-Get-Message-Sender-Via: server159.web-hosting.com: authenticated_id: jteki@openedev.com X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2112 Lines: 55 On 18 May 2015 at 22:02, Jagan Teki wrote: > Fixes Warning encounter this by applying checkpatch.pl against this file: > Prefer ether_addr_copy() over memcpy() if the Ethernet addresses > are __aligned(2) > > pahole output for respective structures: > - addr->sa_data > struct sockaddr { > sa_family_t sa_family; /* 0 2 */ > char sa_data[14]; /* 2 14 */ > > /* size: 16, cachelines: 1, members: 2 */ > /* last cacheline: 16 bytes */ > }; > > - pnetdev->dev_addr > dev_addr is interface address infor from generic net_device structure > which is properly aligned and have some patches with this change as well. > "staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()" > (sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38) > > Signed-off-by: Jagan Teki > Cc: Greg Kroah-Hartman > Cc: Larry Finger > Cc: Florian Schilhabel > --- > Changes for v3: > - Removed unaligned conversions > Changes for v2: > - Describe a changelog, to prove address are aligned > > drivers/staging/rtl8712/os_intfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c > index 6e776e5..d5f4c4d 100644 > --- a/drivers/staging/rtl8712/os_intfs.c > +++ b/drivers/staging/rtl8712/os_intfs.c > @@ -181,7 +181,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p) > struct sockaddr *addr = p; > > if (padapter->bup == false) > - memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN); > + ether_addr_copy(pnetdev->dev_addr, addr->sa_data); > return 0; > } > > -- Ping! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/