aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/usb_intf.c
diff options
context:
space:
mode:
authorHeba Aamer <heba93aamer@gmail.com>2015-01-30 00:11:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-07 17:15:43 +0800
commit36e4d8826b317080e283e4edd08bf8d5ac706f38 (patch)
tree9ff47a45b488d4824bf4cd3b3bf87285e1c58cef /drivers/staging/rtl8712/usb_intf.c
parentSTAGING: Fix pcl818.c coding style issue: line over 80 characters (diff)
downloadlinux-dev-36e4d8826b317080e283e4edd08bf8d5ac706f38.tar.xz
linux-dev-36e4d8826b317080e283e4edd08bf8d5ac706f38.zip
staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()
This patch fixes the following checkpatch.pl warning: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) pahole showed that the struct used pnetdev->dev_addr is aligned to u16. Moreover mac is a simple array, pdata is a pointer that starts from an even offset. Signed-off-by: Heba Aamer <heba93aamer@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/usb_intf.c')
-rw-r--r--drivers/staging/rtl8712/usb_intf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index f1fd7e8d16fd..f8b5b332e7c3 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -462,7 +462,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
/* Use the mac address stored in the Efuse
* offset = 0x12 for usb in efuse
*/
- memcpy(mac, &pdata[0x12], ETH_ALEN);
+ ether_addr_copy(mac, &pdata[0x12]);
}
eeprom_CustomerID = pdata[0x52];
switch (eeprom_CustomerID) {
@@ -579,7 +579,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
} else
dev_info(&udev->dev,
"r8712u: MAC Address from efuse = %pM\n", mac);
- memcpy(pnetdev->dev_addr, mac, ETH_ALEN);
+ ether_addr_copy(pnetdev->dev_addr, mac);
}
/* step 6. Load the firmware asynchronously */
if (rtl871x_load_fw(padapter))