[PATCH 4/4] pci: don't hide hard to understand sanity check in size calculation

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sun Apr 15 11:27:58 PDT 2018


Hello Andrey,

On Sat, Apr 14, 2018 at 09:25:59AM -0700, Andrey Smirnov wrote:
> On Fri, Apr 13, 2018 at 4:30 PM, Uwe Kleine-König
> <u.kleine-koenig at pengutronix.de> wrote:
> > +               /*
> > +                * if maxbase isn't in the form 0b1...10...0 there is something
> > +                * fishy
> > +                */
> > +               if ((maxbase | (maxbase - 1)) != (u32)-1 || maxbase == 0) {
> 
> U32_MAX instead of (u32)-1 ?

I don't feel strong here. Given that the LHS uses some characteristics
of the binary representation I slightly prefer (u32)-1, but I can change
it to U32_MAX, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the barebox mailing list