All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 03/11] ethernet: use eth_hw_addr_set()
Date: Sun, 3 Oct 2021 07:40:53 +0300	[thread overview]
Message-ID: <YVk0VeaCv93ZFNtk@shredder> (raw)
In-Reply-To: <20211002171255.336bbbe8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On Sat, Oct 02, 2021 at 05:12:55PM -0700, Jakub Kicinski wrote:
> 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.

Yes, I agree with using eth_hw_addr_set() for Ethernet drivers as it
will make the drivers in part 1 and part 2 consistent.

  reply	other threads:[~2021-10-03  4:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 21:32 [PATCH net-next 00/11] Use netdev->dev_addr write helpers (part 1) Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 01/11] arch: use eth_hw_addr_set() Jakub Kicinski
2021-10-01 22:59   ` Max Filippov
2021-10-02  9:19   ` Geert Uytterhoeven
2021-10-01 21:32 ` [PATCH net-next 02/11] net: " Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 03/11] ethernet: " Jakub Kicinski
2021-10-02 16:32   ` Ido Schimmel
2021-10-03  0:12     ` Jakub Kicinski
2021-10-03  4:40       ` Ido Schimmel [this message]
2021-10-01 21:32 ` [PATCH net-next 04/11] net: usb: " Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 05/11] net: use eth_hw_addr_set() instead of ether_addr_copy() Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 06/11] ethernet: " Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 07/11] net: usb: " Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 08/11] ethernet: chelsio: use eth_hw_addr_set() Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 09/11] ethernet: s2io: " Jakub Kicinski
2021-10-01 21:32 ` [PATCH net-next 10/11] fddi: " Jakub Kicinski
2021-10-18  2:34   ` Maciej W. Rozycki
2021-10-01 21:32 ` [PATCH net-next 11/11] ethernet: use eth_hw_addr_set() - casts Jakub Kicinski
2021-10-02 15:10 ` [PATCH net-next 00/11] Use netdev->dev_addr write helpers (part 1) patchwork-bot+netdevbpf

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=YVk0VeaCv93ZFNtk@shredder \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --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.