mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: [PATCH 1/7] checkpatch: possible types -- else cannot start a type
Date: Fri, 21 Aug 2009 22:46:04 +0100	[thread overview]
Message-ID: <1250891170-8599-2-git-send-email-apw@canonical.com> (raw)
In-Reply-To: <1250891170-8599-1-git-send-email-apw@canonical.com>

An else cannot start a type, it would have to be within a block after
the else.  This can trigger false modifier matching.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 scripts/checkpatch.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2d5ece7..fd64816 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1372,6 +1372,8 @@ sub process {
 			# Ignore functions being called
 			} elsif ($s =~ /^.\s*$Ident\s*\(/s) {
 
+			} elsif ($s =~ /^.\s*else\b/s) {
+
 			# declarations always start with types
 			} elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) {
 				my $type = $1;
-- 
1.6.3.3


  reply	other threads:[~2009-08-21 21:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 21:46 [PATCH 0/7] update checkpatch to v0.29 Andy Whitcroft
2009-08-21 21:46 ` Andy Whitcroft [this message]
2009-08-21 21:46 ` [PATCH 2/7] checkpatch: handle C99 comments correctly (performance issue) Andy Whitcroft
2009-08-21 21:46 ` [PATCH 3/7] checkpatch: indent checks -- stop when we run out of continuation lines Andy Whitcroft
2009-08-21 21:46 ` [PATCH 4/7] checkpatch: make -f alias --file, add --help, more verbose help message Andy Whitcroft
2009-08-25 11:51   ` Pavel Machek
2009-08-21 21:46 ` [PATCH 5/7] checkpatch: format strings should not have brackets in macros Andy Whitcroft
2009-08-21 21:46 ` [PATCH 6/7] checkpatch: limit sN/uN matches to actual bit sizes Andy Whitcroft
2009-08-21 21:46 ` [PATCH 7/7] checkpatch: version 0.29 Andy Whitcroft
2009-08-21 23:54 ` [PATCH 0/7] update checkpatch to v0.29 Andrew Morton
2009-08-25  7:43 ` checkpatch infinite loop ? Eric Dumazet

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=1250891170-8599-2-git-send-email-apw@canonical.com \
    --to=apw@canonical.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®