All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] staging: ks7010: Replace manual array copy with ether_addr_copy().
@ 2018-03-29  5:51 Quytelda Kahja
  2018-03-29  5:51 ` [PATCH 2/9] staging: ks7010: Remove unecessary cast Quytelda Kahja
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Quytelda Kahja @ 2018-03-29  5:51 UTC (permalink / raw)
  To: gregkh, wsa; +Cc: devel, driverdev-devel, linux-kernel, Quytelda Kahja

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 6106e79c5163..f6e496aa68de 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2900,15 +2900,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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-03-30  6:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29  5:51 [PATCH 1/9] staging: ks7010: Replace manual array copy with ether_addr_copy() Quytelda Kahja
2018-03-29  5:51 ` [PATCH 2/9] staging: ks7010: Remove unecessary cast Quytelda Kahja
2018-03-29  5:51 ` [PATCH 3/9] staging: ks7010: Reorder ks_wlan_netdev_ops members Quytelda Kahja
2018-03-29  9:46   ` Greg KH
2018-03-29  5:51 ` [PATCH 4/9] staging: ks7010: Rename ks_wlan_set_multicast_list() Quytelda Kahja
2018-03-29  5:51 ` [PATCH 5/9] staging: ks7010: Change mac_address_valid to a bool instead of int Quytelda Kahja
2018-03-29  5:51 ` [PATCH 6/9] staging: ks7010: Remove unused member 'reg_net' from 'ks_wlan_private' Quytelda Kahja
2018-03-29  5:51 ` [PATCH 7/9] staging: ks7010: Remove trailing "_t" from all structure names Quytelda Kahja
2018-03-29  9:51   ` Greg KH
2018-03-29  5:51 ` [PATCH 8/9] staging: ks7010: Remove 'eth_addr' field from 'struct ks_wlan_private' Quytelda Kahja
2018-03-29  5:51 ` [PATCH 9/9] staging: ks7010: Remove extra blank line between functions Quytelda Kahja
2018-03-29  6:15   ` Joe Perches
2018-03-29  6:02 ` [PATCH 1/9] staging: ks7010: Replace manual array copy with ether_addr_copy() Joe Perches
2018-03-30  6:03   ` Quytelda Kahja
2018-03-30  6:06     ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.