From: Mark Brown <broonie@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-spi <linux-spi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/1] spi: Remove unneeded parentheses in spi_map_buf()
Date: Mon, 21 Jun 2021 12:59:50 +0100 [thread overview]
Message-ID: <20210621115950.GG4094@sirena.org.uk> (raw)
In-Reply-To: <CAHp75Vc8CDRBKMiJNehsU2CUc4VVrWL9fHZO1rr7V7pZDg_QaQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
On Mon, Jun 21, 2021 at 01:43:41PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 21, 2021 at 1:40 PM Mark Brown <broonie@kernel.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.
This is purely a taste thing. I think the >= and && being the same
length and the second condition being visually distinct from the first
don't help here.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2021-06-21 12:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 11:15 [PATCH v1 1/1] spi: Remove unneeded parentheses in spi_map_buf() Andy Shevchenko
2021-06-21 10:39 ` Mark Brown
2021-06-21 10:43 ` Andy Shevchenko
2021-06-21 11:59 ` Mark Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210621115950.GG4094@sirena.org.uk \
--to=broonie@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox