]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/ozwpan: coding style ether_addr_copy
authorJérôme Pinot <ngc891@gmail.com>
Thu, 13 Mar 2014 15:44:30 +0000 (00:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 21:47:44 +0000 (14:47 -0700)
This fixes the following issues detected by checkpatch.pl:

 WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
 #220: FILE: drivers/staging/ozwpan/ozcdev.c:220:
 +              memcpy(g_cdev.active_addr, addr, ETH_ALEN);

 WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
 #286: FILE: drivers/staging/ozwpan/ozcdev.c:286:
 +                      memcpy(addr, g_cdev.active_addr, ETH_ALEN);

 WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
 #176: FILE: drivers/staging/ozwpan/ozpd.c:176:
 +              memcpy(pd->mac_addr, mac_addr, ETH_ALEN);

Signed-off-by: Jerome Pinot <ngc891@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozcdev.c
drivers/staging/ozwpan/ozpd.c

index 5de5981b3bba9330c33dc1420deb011730bfefec..10c0a96ce8bbfeb9026456be7eca37d2d3a8bed0 100644 (file)
@@ -217,7 +217,7 @@ static int oz_set_active_pd(const u8 *addr)
        pd = oz_pd_find(addr);
        if (pd) {
                spin_lock_bh(&g_cdev.lock);
-               memcpy(g_cdev.active_addr, addr, ETH_ALEN);
+               ether_addr_copy(g_cdev.active_addr, addr);
                old_pd = g_cdev.active_pd;
                g_cdev.active_pd = pd;
                spin_unlock_bh(&g_cdev.lock);
@@ -283,7 +283,7 @@ static long oz_cdev_ioctl(struct file *filp, unsigned int cmd,
                        u8 addr[ETH_ALEN];
                        oz_dbg(ON, "OZ_IOCTL_GET_ACTIVE_PD\n");
                        spin_lock_bh(&g_cdev.lock);
-                       memcpy(addr, g_cdev.active_addr, ETH_ALEN);
+                       ether_addr_copy(addr, g_cdev.active_addr);
                        spin_unlock_bh(&g_cdev.lock);
                        if (copy_to_user((void __user *)arg, addr, ETH_ALEN))
                                return -EFAULT;
index 29a23a325d71eefbbd3652bf3cc01a8c4d33c918..10f1b3ac88322cfd3f81e9a048e082db14bccc9c 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/timer.h>
 #include <linux/sched.h>
 #include <linux/netdevice.h>
+#include <linux/etherdevice.h>
 #include <linux/errno.h>
 #include "ozdbg.h"
 #include "ozprotocol.h"
@@ -173,7 +174,7 @@ struct oz_pd *oz_pd_alloc(const u8 *mac_addr)
                pd->last_rx_pkt_num = 0xffffffff;
                oz_pd_set_state(pd, OZ_PD_S_IDLE);
                pd->max_tx_size = OZ_MAX_TX_SIZE;
-               memcpy(pd->mac_addr, mac_addr, ETH_ALEN);
+               ether_addr_copy(pd->mac_addr, mac_addr);
                if (0 != oz_elt_buf_init(&pd->elt_buff)) {
                        kfree(pd);
                        pd = NULL;