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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230524175307.GB7074@pengutronix.de>
Date:   Wed, 24 May 2023 19:53:07 +0200
From:   Oleksij Rempel <o.rempel@...gutronix.de>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Woojung Huh <woojung.huh@...rochip.com>,
        Arun Ramadoss <arun.ramadoss@...rochip.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "Russell King (Oracle)" <linux@...linux.org.uk>,
        Vladimir Oltean <vladimir.oltean@....com>,
        linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com,
        Eric Dumazet <edumazet@...gle.com>,
        Vladimir Oltean <olteanv@...il.com>, kernel@...gutronix.de,
        netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next v1 2/5] net: dsa: microchip: add an enum for
 regmap widths

On Wed, May 24, 2023 at 07:03:38PM +0200, Andrew Lunn wrote:
> On Wed, May 24, 2023 at 02:32:17PM +0200, Oleksij Rempel wrote:
> > From: Vladimir Oltean <vladimir.oltean@....com>
> > 
> > It is not immediately obvious that this driver allocates, via the
> > KSZ_REGMAP_TABLE() macro, 3 regmaps for register access: dev->regmap[0]
> > for 8-bit access, dev->regmap[1] for 16-bit and dev->regmap[2] for
> > 32-bit access.
> > 
> > In future changes that add support for reg_fields, each field will have
> > to specify through which of the 3 regmaps it's going to go. Add an enum
> > now, to denote one of the 3 register access widths, and make the code go
> > through some wrapper functions for easier review and further
> > modification.
> 
> Given the patches in this series, it is not obvious why the wrapper is
> needed.
> 
> dev->regmap[KSZ_REGMAP_8] is just as readable as ksz_regmap_8(dev).
>
> Do future changes add extra parameters to ksz_regmap_8()?

As for me, it looks short. Less problems with line length restrictions.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ