mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Joel Schopp <jschopp@austin.ibm.com>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Andy Whitcroft <apw@shadowen.org>
Subject: [PATCH 08/13] checkpatch: complex macros checks miss square brackets
Date: Fri,  3 Oct 2008 16:25:49 +0100	[thread overview]
Message-ID: <1223047554-31111-9-git-send-email-apw@shadowen.org> (raw)
In-Reply-To: <1223047554-31111-1-git-send-email-apw@shadowen.org>

We are missing 'simple' values which include square brackets.  Refactor
to ensure we handle nesting correctly and detect these simple forms.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 scripts/checkpatch.pl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c479bde..54dfa2b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2142,9 +2142,10 @@ sub process {
 			$dstat =~ s/\s*$//s;
 
 			# Flatten any parentheses and braces
-			while ($dstat =~ s/\([^\(\)]*\)/1/) {
-			}
-			while ($dstat =~ s/\{[^\{\}]*\}/1/) {
+			while ($dstat =~ s/\([^\(\)]*\)/1/ ||
+			       $dstat =~ s/\{[^\{\}]*\}/1/ ||
+			       $dstat =~ s/\[[^\{\}]*\]/1/)
+			{
 			}
 
 			my $exceptions = qr{
-- 
1.6.0.1.451.gc8d31


  parent reply	other threads:[~2008-10-03 15:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 15:25 [PATCH 00/13] checkpatch: update to version 0.24 Andy Whitcroft
2008-10-03 15:25 ` [PATCH 01/13] checkpatch: do is not a possible type Andy Whitcroft
2008-10-03 15:25 ` [PATCH 02/13] checkpatch: labels are not possible types Andy Whitcroft
2008-10-03 15:25 ` [PATCH 03/13] checkpatch: handle do without braces if we have enough context Andy Whitcroft
2008-10-03 15:25 ` [PATCH 04/13] checkpatch: macros which define structure members are not complex Andy Whitcroft
2008-10-03 15:25 ` [PATCH 05/13] checkpatch: accept any sized le/be type Andy Whitcroft
2008-10-03 15:25 ` [PATCH 06/13] checkpatch: pull out known acceptable typedefs Andy Whitcroft
2008-10-03 15:25 ` [PATCH 07/13] checkpatch: suspect code indent must stop at #else/#elif Andy Whitcroft
2008-10-03 15:25 ` Andy Whitcroft [this message]
2008-10-03 15:25 ` [PATCH 09/13] checkpatch: DEFINE_ macros are real definitions for exports Andy Whitcroft
2008-10-03 15:25 ` [PATCH 10/13] checkpatch: trailing statements ensure we report the end of the line Andy Whitcroft
2008-10-03 15:25 ` [PATCH 11/13] checkpatch: suspect indent handle macro continuation Andy Whitcroft
2008-10-03 15:25 ` [PATCH 12/13] checkpatch: allow for comments either side of a brace on case Andy Whitcroft
2008-10-03 15:25 ` [PATCH 13/13] checkpatch: version: 0.24 Andy Whitcroft

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=1223047554-31111-9-git-send-email-apw@shadowen.org \
    --to=apw@shadowen.org \
    --cc=akpm@osdl.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rdunlap@xenotime.net \
    /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®