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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 8 Feb 2022 18:51:20 +0000
From:   Holger Brunck <holger.brunck@...achienergy.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Marek BehĂșn <kabel@...nel.org>
Subject: RE: [v4] dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude
 configurable

> 
> > +static struct mv88e6352_serdes_p2p_to_val
> > +mv88e6352_serdes_p2p_to_val[] = {
> 
> Please add a const to this. It will make the memory usage a little smaller and
> help protect from overwrite.
>

ok
 
> > +     /* Mapping of configurable mikrovolt values to the register value */
> > +     { 14000, 0},
> > +     { 112000, 1},
> > +     { 210000, 2},
> > +     { 308000, 3},
> > +     { 406000, 4},
> > +     { 504000, 5},
> > +     { 602000, 6},
> > +     { 700000, 7},
> > +};
> > +
> > +int mv88e6352_serdes_set_tx_p2p_amplitude(struct mv88e6xxx_chip *chip,
> int port,
> > +                                       int val) {
> > +     bool found = false;
> > +     u16 reg;
> > +     int err;
> > +     int i;
> > +
> > +     if (!mv88e6352_port_has_serdes(chip, port))
> > +             return -EOPNOTSUPP;
> 
> Russell just reworked this call. Did you take that into account?
> 

no I was not aware of this. Thanks for pointing out. I will base my
changes then on his patch series.

> > +
> > +     for (i = 0; i < ARRAY_SIZE(mv88e6352_serdes_p2p_to_val); ++i) {
> > +             if (mv88e6352_serdes_p2p_to_val[i].mv == val) {
> > +                     reg = mv88e6352_serdes_p2p_to_val[i].regval;
> 
> i has the same value as mv88e6352_serdes_p2p_to_val[i].regval, so you can
> drop it and just use i.
> 

ok

Best regards
Holger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ