mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tal Shorer <tal.shorer@gmail.com>
To: tal.shorer@gmail.com, apw@canonical.com, joe@perches.com
Cc: linux-kernel@vger.kernel.org
Subject: possible new false positive in checkpatch
Date: Sat, 12 Sep 2015 15:13:31 +0300	[thread overview]
Message-ID: <1442060011-3996-1-git-send-email-tal.shorer@gmail.com> (raw)

Since my last pull from upstream (today) , I started seeing some
checkpatch warnings regarding suspect code indent I believe are false
positive. Take this code for example:

static int foo(void)
{
	while (bar())
		/* do nothing */;
}

When running checkpath on it, the following warning is emitted:

tal@tal:~/Dev/lfs/linux|0 $ scripts/checkpatch.pl -f ~/tmp/foo.c
WARNING: suspect code indent for conditional statements (8, 32)
#3: FILE: /home/tal/tmp/foo.c:3:
+	while (bar())
+		/* do nothing */;

total: 0 errors, 1 warnings, 5 lines checked

/home/tal/tmp/foo.c has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
tal@tal:~/Dev/lfs/linux|1 $ 

Using my limited perl knowledge, I believe the lines causing this are
3111-3133:
			# remove inline comments
			$s =~ s/$;/ /g;
			$c =~ s/$;/ /g;
Introduced in commit 9f5af480f4554aac12e002b6f5c2b04895857700:
checkpatch: improve SUSPECT_CODE_INDENT test
Commenting out these lines removes the warning.

This pattern exists in many places around the kernel source.
Is this the intended behavior?

             reply	other threads:[~2015-09-12 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-12 12:13 Tal Shorer [this message]
2015-09-14 10:27 ` Andy Whitcroft
2015-09-15 14:50   ` Tal Shorer
2015-09-15 15:01     ` Andy Whitcroft
2015-10-26 16:43       ` Tal Shorer
2016-06-11  7:33       ` Tal Shorer

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=1442060011-3996-1-git-send-email-tal.shorer@gmail.com \
    --to=tal.shorer@gmail.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --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®