[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211002171255.336bbbe8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Sat, 2 Oct 2021 17:12:55 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Ido Schimmel <idosch@...sch.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 03/11] ethernet: use eth_hw_addr_set()
On Sat, 2 Oct 2021 19:32:53 +0300 Ido Schimmel wrote:
> On Fri, Oct 01, 2021 at 02:32:20PM -0700, Jakub Kicinski wrote:
> > Convert all Ethernet drivers from memcpy(... ETH_ADDR)
> > to eth_hw_addr_set():
> >
> > @@
> > expression dev, np;
> > @@
> > - memcpy(dev->dev_addr, np, ETH_ALEN)
> > + eth_hw_addr_set(dev, np)
>
> Some use:
>
> memcpy(dev->dev_addr, np, dev->addr_len)
>
> Not sure if you missed it or if it's going to be in part 2. I assume the
> latter, but thought I would ask.
Yup, still
417 files changed, 1239 insertions(+), 960 deletions(-)
to go. I thought I'd start upstreaming from the most obvious /
mechanical changes.
For the memcpy(..., dev->addr_len) I'm thinking of using
eth_hw_addr_set() in appropriate sections of the tree (drivers/ethernet,
driver/wireless) and convert the rest to this helper:
static inline void dev_addr_set(struct net_device *dev, const u8 *addr)
{
memcpy(dev->dev_addr, addr, dev->addr_len);
}
dev_addr_set() everywhere would be more obviously correct, but using
eth_hw_addr_set() seems cleaner for Ethernet drivers. Second opinion
on this would be good if you have a preference.
Powered by blists - more mailing lists