linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] checkpatch: Improve "no space necessary after cast" test
Date: Sun,  1 Feb 2015 20:27:38 -0800	[thread overview]
Message-ID: <11770ac52f747aba98d13672abc553b4919a6e44.1422851104.git.joe@perches.com> (raw)
In-Reply-To: <cover.1422851104.git.joe@perches.com>

Code like:
	if (a < sizeof(<type>) &&
and
	{ .len = sizeof(<type>) },

incorrectly emits that warning, so add more exceptions to avoid
the warning.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7f1804e..a9baaab 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2541,7 +2541,7 @@ sub process {
 			}
 		}
 
-		if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ &&
+		if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;:\?\(\{\}\[\<\>]|&&|\|\||\\$)/ &&
 		    (!defined($1) || $1 !~ /sizeof\s*/)) {
 			if (CHK("SPACING",
 				"No space is necessary after a cast\n" . $herecurr) &&
-- 
2.1.2


  parent reply	other threads:[~2015-02-02  4:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  4:27 [PATCH 0/5] checkpatch: Miscellaneous cleanups Joe Perches
2015-02-02  4:27 ` [PATCH 1/5] checkpatch: Improve seq_print->seq_puts suggestion Joe Perches
2015-02-02  4:27 ` Joe Perches [this message]
2015-02-02  4:27 ` [PATCH 3/5] checkpatch: Neaten printk_ratelimited message position Joe Perches
2015-02-02  4:27 ` [PATCH 4/5] checkpatch: Add --strict test for spaces around arithmetic Joe Perches
2015-02-02  4:27 ` [PATCH 5/5] checkpatch: Make sure a commit reference description uses parentheses Joe Perches

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=11770ac52f747aba98d13672abc553b4919a6e44.1422851104.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.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;
as well as URLs for NNTP newsgroup(s).