lkml.org 
[lkml]   [2020]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH net-next v7 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices
On Mon, Sep 7, 2020 at 10:30 AM Vadym Kochan <vadym.kochan@plvision.eu> wrote:
> On Fri, Sep 04, 2020 at 10:12:07PM +0300, Andy Shevchenko wrote:
> > On Fri, Sep 4, 2020 at 7:52 PM Vadym Kochan <vadym.kochan@plvision.eu> wrote:

I'm assuming that you agree on all non-commented.

...

> > > +#define prestera_dev(sw) ((sw)->dev->dev)
> >
> > The point of this is...? (What I see it's 2 characters longer)
> >
> > ...
> It is not about the length but rather about easier semantics, so
> the prestera_dev() is more easier to remember than sw->dev->dev.

It actually makes it opposite, now I have to go somewhere in the file,
quite far from the place where it is used, and check what it is. Then
I return to the code I'm reading and after a few more lines of code I
will forget what that macro means.

...

> > > + /* firmware requires that port's mac address consist of the first
> > > + * 5 bytes of base mac address
> > > + */
> >
> >
> > > + memcpy(dev->dev_addr, sw->base_mac, dev->addr_len - 1);
> >
> > Can't you call above helper for that?
>
> Not sure if I got this right, but I assume that may be just use
> ether_addr_copy() and then just perform the below assignment on the
> last byte ?

No, I mean the function where you have the same comment and something
else. I'm wondering if you may call it from here. Or refactor code to
make it possible to call from here.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-09-07 09:57    [W:0.081 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site