mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
To: <linux-kernel@vger.kernel.org>
Cc: <joe@perches.com>, Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
Subject: [PATCH] checkpatch.pl: Fix wrong curly bracket position reporting
Date: Tue, 17 Dec 2013 18:59:51 -0800	[thread overview]
Message-ID: <1387335591-8741-1-git-send-email-jtheou@adeneo-embedded.us> (raw)

This patch fixes wrong curly bracket position reporting when function
declarations have only one void argument.

Missing error (ERROR: space required before the open brace '{') on this
situation :

int foo(void){
	...
}

Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8f3aecd..3a18c5e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3159,7 +3159,7 @@ sub process {
 ## 		}
 
 #need space before brace following if, while, etc
-		if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
+		if (($line =~ /\(.*\){/ && ($line =~ /\(void\){/ || $line !~ /\($Type\){/)) ||
 		    $line =~ /do{/) {
 			if (ERROR("SPACING",
 				  "space required before the open brace '{'\n" . $herecurr) &&
-- 
1.8.4.2


             reply	other threads:[~2013-12-18  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18  2:59 Jean-Baptiste Theou [this message]
2013-12-18  5:39 ` Joe Perches
2013-12-18 17:43   ` Jean-Baptiste Theou
  -- strict thread matches above, loose matches on Subject: below --
2013-12-18  2:56 Jean-Baptiste Theou

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=1387335591-8741-1-git-send-email-jtheou@adeneo-embedded.us \
    --to=jtheou@adeneo-embedded.us \
    --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®