linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: apw@canonical.com, joe@perches.com
Subject: [PATCH 1/1] checkpatch: improve operator spacing check
Date: Tue,  7 Apr 2015 13:36:00 +1000	[thread overview]
Message-ID: <203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com> (raw)

Code such as:
       x = timercmp(&now, &end, <);
Will currently trigger a checkpatch error. e.g.

ERROR: spaces required around that '<'

This is because the "Ignore operators passed as parameters" check
looks only for a comma following the operator. Improve the check by
also looking for a close parenthesis.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---

 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..f65c4de 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3565,7 +3565,7 @@ sub process {
 
 				# Ignore operators passed as parameters.
 				if ($op_type ne 'V' &&
-				    $ca =~ /\s$/ && $cc =~ /^\s*,/) {
+				    $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) {
 
 #				# Ignore comments
 #				} elsif ($op =~ /^$;+$/) {
-- 
1.7.10.4


             reply	other threads:[~2015-04-07  3:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07  3:36 Sam Bobroff [this message]
2015-04-07  3:52 ` [PATCH 1/1] checkpatch: improve operator spacing check 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=203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com \
    --to=sam.bobroff@au1.ibm.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;
as well as URLs for NNTP newsgroup(s).