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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 21 Jun 2021 13:43:41 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-spi <linux-spi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/1] spi: Remove unneeded parentheses in spi_map_buf()

On Mon, Jun 21, 2021 at 1:40 PM Mark Brown <broonie@...nel.org> wrote:
>
> On Sat, Jun 19, 2021 at 02:15:26PM +0300, Andy Shevchenko wrote:
> > The boolean expression to get kmap_buf is hard to read due to
> > too many unneeded parentheses. Remove them for good.
>
> > -     const bool kmap_buf = ((unsigned long)buf >= PKMAP_BASE &&
> > -                             (unsigned long)buf < (PKMAP_BASE +
> > -                                     (LAST_PKMAP * PAGE_SIZE)));
> > +     const bool kmap_buf = (unsigned long)buf >= PKMAP_BASE &&
> > +                           (unsigned long)buf < (PKMAP_BASE + LAST_PKMAP * PAGE_SIZE);
>
> No, I think this makes things worse - to the extent there's an issue
> here it's not excessive brackets.

How? I can't see any issues here and dropping excessive brackets helps
to read it better. For example, the exterior brackets do nothing
except making it harder to read, i.e. the expression inside them is
already type of boolean and I have no clue what they are for.



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ