lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Sep 2020 10:55:49 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Vadym Kochan <vadym.kochan@...ision.eu>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Pirko <jiri@...lanox.com>,
        Ido Schimmel <idosch@...lanox.com>,
        Andrew Lunn <andrew@...n.ch>,
        Oleksandr Mazur <oleksandr.mazur@...ision.eu>,
        Serhiy Boiko <serhiy.boiko@...ision.eu>,
        Serhiy Pshyk <serhiy.pshyk@...ision.eu>,
        Volodymyr Mytnyk <volodymyr.mytnyk@...ision.eu>,
        Taras Chornyi <taras.chornyi@...ision.eu>,
        Andrii Savka <andrii.savka@...ision.eu>,
        netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mickey Rachamim <mickeyr@...vell.com>
Subject: Re: [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@...ision.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@...ision.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

Powered by blists - more mailing lists