lkml.org 
[lkml]   [2018]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 68/76] staging: ks7010: Replace manual array copy with ether_addr_copy().
Date
Copying the dummy HW address into the struct net_device doesn't need
to be done byte by byte; use ether_addr_copy() instead.
Additionally, dev->dev_addr is not eight bytes long.
ether_setup() sets the dev->addr_len to ETH_ALEN (defined as 6)
in the net core code.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
drivers/staging/ks7010/ks_wlan_net.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 72a52c6f9fd2..d6bfbc1f8558 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2884,15 +2884,7 @@ int ks_wlan_net_start(struct net_device *dev)
timer_setup(&update_phyinfo_timer, ks_wlan_update_phyinfo_timeout, 0);

/* dummy address set */
- memcpy(priv->eth_addr, dummy_addr, ETH_ALEN);
- dev->dev_addr[0] = priv->eth_addr[0];
- dev->dev_addr[1] = priv->eth_addr[1];
- dev->dev_addr[2] = priv->eth_addr[2];
- dev->dev_addr[3] = priv->eth_addr[3];
- dev->dev_addr[4] = priv->eth_addr[4];
- dev->dev_addr[5] = priv->eth_addr[5];
- dev->dev_addr[6] = 0x00;
- dev->dev_addr[7] = 0x00;
+ ether_addr_copy(dev->dev_addr, priv->eth_addr);

/* The ks_wlan-specific entries in the device structure. */
dev->netdev_ops = &ks_wlan_netdev_ops;
--
2.16.3
\
 
 \ /
  Last update: 2018-03-30 09:13    [W:1.117 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site