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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 15 Nov 2021 13:21:24 +0100
From:   Krzysztof Wilczyński <kw@...ux.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     bcm-kernel-feedback-list@...adcom.com,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        Jim Quinlan <jim2101024@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v1 1/1] PCI: brcmstb: Use GENMASK() as __GENMASK() is for
 internal use only

Hi Andy,

> On Wed, Oct 27, 2021 at 12:00:16PM +0200, Krzysztof Wilczyński wrote:
> > > Use GENMASK() as __GENMASK() is for internal use only.
> >
> > To add, for posterity, that using __GENMASK() bypasses the
> > GENMASK_INPUT_CHECK() macro that adds extra validation.
>
> In general, yes, but here we have a variable...
>
> > > - u32 val = __GENMASK(31, msi->legacy_shift);
> > > + u32 val = GENMASK(31, msi->legacy_shift);
>
> ...which make me thing that the whole construction is ugly
> (and I truly believe the code is very ugly here, because
>  the idea behind GENMASK() is to be used with constants).
>
> So, what about
>
>       u32 val = ~(BIT(msi->legacy_shift) - 1);
>
> instead?

Sorry for late reply!  Thankfully, you've sent a v2 using the BIT() macro
already.  Thank you!

	Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ