Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751918AbbEQVQp (ORCPT ); Sun, 17 May 2015 17:16:45 -0400 Received: from s159.web-hosting.com ([68.65.121.203]:56085 "EHLO s159.web-hosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbbEQVQn (ORCPT ); Sun, 17 May 2015 17:16:43 -0400 X-Greylist: delayed 1150 seconds by postgrey-1.27 at vger.kernel.org; Sun, 17 May 2015 17:16:43 EDT From: Jagan Teki To: linux-kernel@vger.kernel.org Cc: devel@driverdev.osuosl.org, Jagan Teki , Greg Kroah-Hartman , Larry Finger , Florian Schilhabel Subject: [PATCH] staging: rtl8712: Use ether_addr_copy() instead of memcpy() Date: Mon, 18 May 2015 02:27:01 +0530 Message-Id: <1431896221-7599-1-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 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: 2071 Lines: 57 This patch fixes to use ether_addr_copy() instead of memcpy() Encounter this by applying checkpatch.pl against this file: WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) Signed-off-by: Jagan Teki Cc: Greg Kroah-Hartman Cc: Larry Finger Cc: Florian Schilhabel --- drivers/staging/rtl8712/os_intfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 6e776e5..0d27df6 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; } @@ -395,8 +395,8 @@ static int netdev_open(struct net_device *pnetdev) goto netdev_open_error; if (r8712_initmac == NULL) /* Use the mac address stored in the Efuse */ - memcpy(pnetdev->dev_addr, - padapter->eeprompriv.mac_addr, ETH_ALEN); + ether_addr_copy(pnetdev->dev_addr, + padapter->eeprompriv.mac_addr); else { /* We have to inform f/w to use user-supplied MAC * address. @@ -412,8 +412,8 @@ static int netdev_open(struct net_device *pnetdev) * the eeprompriv.mac_addr should store the mac which * users specify. */ - memcpy(padapter->eeprompriv.mac_addr, - pnetdev->dev_addr, ETH_ALEN); + ether_addr_copy(padapter->eeprompriv.mac_addr, + pnetdev->dev_addr); } if (start_drv_threads(padapter) != _SUCCESS) goto netdev_open_error; -- 1.9.1 -- 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/