mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Matthijs Kooijman <matthijs@stdin.nl>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Only warn for empty lines before closing braces by themselves
Date: Thu, 11 Apr 2013 11:46:55 -0700	[thread overview]
Message-ID: <1365706015.1929.32.camel@joe-AO722> (raw)
In-Reply-To: <20130410084927.GR13691@login.drsnuggles.stderr.nl>

On Wed, 2013-04-10 at 10:49 +0200, Matthijs Kooijman wrote:
> This check was intended to catch extra newlines at the end of a function
> definition, but it would trigger on any closing brace, including those
> of inline functions and macro definitions, triggering false positives.
> Now, only closing braces on a line by themselves trigger this check.
[]
> Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>

Acked-by: Joe Perches <joe@perches.com>

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 532c41b..f962c30 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3236,7 +3236,7 @@ sub process {
>  		}
>  
>  # check for unnecessary blank lines around braces
> -		if (($line =~ /^..*}\s*$/ && $prevline =~ /^.\s*$/)) {
> +		if (($line =~ /^.\s*}\s*$/ && $prevline =~ /^.\s*$/)) {
>  			CHK("BRACES",
>  			    "Blank lines aren't necessary before a close brace '}'\n" . $hereprev);
>  		}



      reply	other threads:[~2013-04-11 18:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  8:49 Matthijs Kooijman
2013-04-11 18:46 ` Joe Perches [this message]

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=1365706015.1929.32.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthijs@stdin.nl \
    /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®