Re: [PATCH V2] checkpatch: extend line continuation test

From: Jingoo Han
Date: Sun Nov 18 2012 - 20:06:06 EST


On Saturday, November 17, 2012 4:31 AM, Joe Perches wrote
>
> Preprocessor directives and asm statements should be
> allowed to have a line continuation.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>


Tested-by: Jingoo Han <jg1.han@xxxxxxxxxxx>

Best regards,
Jingoo Han


> ---
> V2:
> Make the check for preprocessor directives work properly
> # is not optional.
>
> scripts/checkpatch.pl | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d2d5ba1..bfb06ee 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3006,10 +3006,12 @@ sub process {
> }
> }
>
> -# check for line continuations outside of #defines
> +# check for line continuations outside of #defines, preprocessor #, and asm
>
> } else {
> if ($prevline !~ /^..*\\$/ &&
> + $line !~ /^\+\s*\#.*\\$/ && # preprocessor
> + $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
> $line =~ /^\+.*\\$/) {
> WARN("LINE_CONTINUATIONS",
> "Avoid unnecessary line continuations\n" . $herecurr);


--
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/