mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Julius Werner <jwerner@chromium.org>
Cc: Andy Whitcroft <apw@canonical.com>,
	Ivo Sieben <meltedpianoman@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/3] Detect suspicious indentation after conditional
Date: Thu, 15 Apr 2021 16:55:58 -0700	[thread overview]
Message-ID: <3cf12c9eae59e4014865866529e580d7d0ede020.camel@perches.com> (raw)
In-Reply-To: <CAODwPW_rdHnkKuAhCxbF9Lb3bPvAKR54G1wowFGyoDQ_sp-3Cg@mail.gmail.com>

On Wed, 2021-04-14 at 14:18 -0700, Julius Werner wrote:
> *friendly ping*
> 
> Hi Andy, Joe,
> 
> Any comments on this patch series? Are you guys the right point of
> contact for checkpatch changes?

I don't have any issue with this patch set, but Andy is really
the person that should approve any changes to this block of code.

> On Thu, Mar 25, 2021 at 8:50 PM Julius Werner <jwerner@chromium.org> wrote:
> > 
> > This patch series is adding functionality to checkpatch.pl to test for
> > incorrect code indentation after a conditional statement, like this:
> > 
> >  if (a)
> >    b;
> >    c;
> > 
> > (Indentation implies that `c;` was guarded by the conditional, but it
> > isn't.) The main part is re-sending a patch from Ivo Sieben that was
> > already proposed in 2014 [1]. I don't know why it was never merged --
> > it seems that there was no discussion on it. I hope that it was only
> > overlooked, because it works great, and I think this is a very important
> > class of common error to catch.
> > 
> > I have tested it extensively on the kernel tree and in the course of
> > that found a few more edge cases that get fixed by the other two
> > patches. With all these applied, the vast majority of hits I get from
> > this check on the kernel tree are actual indentation errors or other
> > code style violations (e.g. case label and statement on the same line).
> > The only significant remaining group of false positives I found are
> > cases of macros being defined within a function, which are overall very
> > rare. I think the benefit of adding this check would far outweigh the
> > remaining amount of noise.
> > 
> > [1]: https://lore.kernel.org/patchwork/patch/465116
> > 
> > Ivo Sieben (1):
> >   Suspicious indentation detection after conditional statement
> > 
> > Julius Werner (2):
> >   checkpatch: ctx_statement_block: Fix preprocessor guard tracking
> >   checkpatch: Ignore labels when checking indentation
> > 
> >  scripts/checkpatch.pl | 56 +++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 52 insertions(+), 4 deletions(-)
> > 
> > --
> > 2.29.2
> > 



  reply	other threads:[~2021-04-15 23:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  3:50 Julius Werner
2021-03-26  3:50 ` [PATCH 1/3] checkpatch: ctx_statement_block: Fix preprocessor guard tracking Julius Werner
2021-03-26  3:50 ` [PATCH 2/3] Suspicious indentation detection after conditional statement Julius Werner
2021-03-26  3:50 ` [PATCH 3/3] checkpatch: Ignore labels when checking indentation Julius Werner
2021-04-14 21:18 ` [PATCH 0/3] Detect suspicious indentation after conditional Julius Werner
2021-04-15 23:55   ` Joe Perches [this message]
2021-04-30 21:12     ` Julius Werner

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=3cf12c9eae59e4014865866529e580d7d0ede020.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meltedpianoman@gmail.com \
    /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®