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); WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) #795: FILE: drivers/staging/ozwpan/ozproto.c:795: + memcpy(&addr[count++], pd->mac_addr, ETH_ALEN); Signed-off-by: Jerome Pinot <ngc891@xxxxxxxxx> --- drivers/staging/ozwpan/ozcdev.c | 4 ++-- drivers/staging/ozwpan/ozpd.c | 2 +- drivers/staging/ozwpan/ozproto.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 5de5981..10c0a96 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c @@ -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; diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c index 29a23a3..4740238 100644 --- a/drivers/staging/ozwpan/ozpd.c +++ b/drivers/staging/ozwpan/ozpd.c @@ -173,7 +173,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; diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index f09acd0..a7e953d 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -792,7 +792,7 @@ int oz_get_pd_list(struct oz_mac_addr *addr, int max_count) if (count >= max_count) break; pd = container_of(e, struct oz_pd, link); - memcpy(&addr[count++], pd->mac_addr, ETH_ALEN); + ether_addr_copy(&addr[count++], pd->mac_addr); } spin_unlock_bh(&g_polling_lock); return count; -- 1.8.4 -- Jérôme Pinot http://ngc891.blogdns.net/ _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel