All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 10/12] net: plip: use eth_hw_addr_set()
Date: Wed, 20 Oct 2021 08:56:15 -0700	[thread overview]
Message-ID: <20211020155617.1721694-11-kuba@kernel.org> (raw)
In-Reply-To: <20211020155617.1721694-1-kuba@kernel.org>

Get it ready for constant netdev->dev_addr.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/plip/plip.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index 82d609401711..0d491b4d6667 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -284,12 +284,16 @@ static const struct net_device_ops plip_netdev_ops = {
 static void
 plip_init_netdev(struct net_device *dev)
 {
+	static const u8 addr_init[ETH_ALEN] = {
+		0xfc, 0xfc, 0xfc,
+		0xfc, 0xfc, 0xfc,
+	};
 	struct net_local *nl = netdev_priv(dev);
 
 	/* Then, override parts of it */
 	dev->tx_queue_len 	 = 10;
 	dev->flags	         = IFF_POINTOPOINT|IFF_NOARP;
-	memset(dev->dev_addr, 0xfc, ETH_ALEN);
+	eth_hw_addr_set(dev, addr_init);
 
 	dev->netdev_ops		 = &plip_netdev_ops;
 	dev->header_ops          = &plip_header_ops;
@@ -1109,7 +1113,7 @@ plip_open(struct net_device *dev)
 		   plip_init_dev(). */
 		const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list);
 		if (ifa != NULL) {
-			memcpy(dev->dev_addr+2, &ifa->ifa_local, 4);
+			dev_addr_mod(dev, 2, &ifa->ifa_local, 4);
 		}
 	}
 
-- 
2.31.1


  parent reply	other threads:[~2021-10-20 15:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 15:56 [PATCH net-next 00/12] net: don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 01/12] net: xen: use eth_hw_addr_set() Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 02/12] usb: smsc: " Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 03/12] net: qmi_wwan: use dev_addr_mod() Jakub Kicinski
2021-10-20 16:11   ` Bjørn Mork
2021-10-20 15:56 ` [PATCH net-next 04/12] net: usb: don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-21  9:55   ` Oliver Neukum
2021-10-21 13:06     ` Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 05/12] fddi: defxx,defza: use dev_addr_set() Jakub Kicinski
2021-10-20 18:16   ` Maciej W. Rozycki
2021-10-20 15:56 ` [PATCH net-next 06/12] fddi: skfp: constify and " Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 07/12] net: fjes: constify and use eth_hw_addr_set() Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 08/12] net: hippi: use dev_addr_set() Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 09/12] net: s390: constify and use eth_hw_addr_set() Jakub Kicinski
2021-10-20 22:30   ` Julian Wiedmann
2021-10-21 13:05     ` Jakub Kicinski
2021-10-20 15:56 ` Jakub Kicinski [this message]
2021-10-20 15:56 ` [PATCH net-next 11/12] net: sb1000,rionet: " Jakub Kicinski
2021-10-20 15:56 ` [PATCH net-next 12/12] net: hldc_fr: use dev_addr_set() Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020155617.1721694-11-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.