mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jan Schlien <list.lkml@jan-o-sch.net>,
	Andy Whitcroft <apw@canonical.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] checkpatch: non-standard types cannot be declared after '}'
Date: Wed, 30 Dec 2020 10:52:23 -0800	[thread overview]
Message-ID: <58de45f3a0c7a4517110523edeccf19e6cec538c.camel@perches.com> (raw)
In-Reply-To: <d2314c57-30c5-2af9-11ef-6ae1c35a9bb5@jan-o-sch.net>

On Wed, 2020-12-30 at 14:36 +0100, Jan Schlien wrote:
> Hi,
> 
> I found some odd behavior of checkpatch.pl, which I'm currently using
> for own projects outside the kernel, but I verified that kernel patches
> can be affected as well.

Hello Jan.

I've had this patch locally for awhile that I believe fixes this
and another issue ($stat blocks can start with a close brace).

I've been waiting for Andy to review it in case there's some other
parsing problem associated with it.
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 00085308ed9d..012c8dc6cb1a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1555,7 +1555,7 @@ sub ctx_statement_block {
 
 		# Statement ends at the ';' or a close '}' at the
 		# outermost level.
-		if ($level == 0 && $c eq ';') {
+		if ($level == 0 && ($c eq ';' || $c eq '}')) {
 			last;
 		}
 


  reply	other threads:[~2020-12-30 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 13:36 Jan Schlien
2020-12-30 18:52 ` Joe Perches [this message]
2020-12-30 20:06   ` Jan Schlien

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=58de45f3a0c7a4517110523edeccf19e6cec538c.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=list.lkml@jan-o-sch.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®