From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: checkpatch: exclude drivers/staging from if with unnecessary parentheses test
Date: Thu, 11 Jan 2018 17:17:53 -0800 [thread overview]
Message-ID: <1515719873.9619.179.camel@perches.com> (raw)
In-Reply-To: <20180111150319.86ca6ee1c16b85e4c0e034a0@linux-foundation.org>
On Thu, 2018-01-11 at 15:03 -0800, Andrew Morton wrote:
> On Thu, 11 Jan 2018 12:53:54 -0800 Joe Perches <joe@perches.com> wrote:
>
> > Greg KH doesn't like this test so exclude the staging directory
> > from the implied --strict only test unless --strict is actually
> > used on the command-line.
> >
>
> "doesn't like" is rather vague. What is the objection, specifically?
Unnecessary parentheses sometimes make code
easier to read for those that don't know C
very well. i.e.: Greg and maybe others too.
> Also, an example of code which has an "if with unnecessary parentheses"
> would help others understand the decision.
if ((foo == bar) &&
(baz != qux))
where the parentheses around the comparisons are
generically unnecessary as the && is a much higher
precedence than the comparisons.
next prev parent reply other threads:[~2018-01-12 1:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 20:53 Joe Perches
2018-01-11 23:03 ` Andrew Morton
2018-01-12 1:17 ` Joe Perches [this message]
2018-01-12 1:40 ` Andrew Morton
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=1515719873.9619.179.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®