Re: [PATCH] checkpatch: Only warn for empty lines before closingbraces by themselves

From: Joe Perches
Date: Thu Apr 11 2013 - 14:47:01 EST


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@xxxxxxxx>

Acked-by: Joe Perches <joe@xxxxxxxxxxx>

> 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);
> }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/