The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Joe Perches'" <joe@perches.com>,
	"'Andrew Morton'" <akpm@linux-foundation.org>
Cc: "'Andy Whitcroft'" <apw@canonical.com>,
	peter@hurleysoftware.com, "'LKML'" <linux-kernel@vger.kernel.org>,
	"'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [PATCH V2] checkpatch: extend line continuation test
Date: Mon, 19 Nov 2012 10:06:10 +0900	[thread overview]
Message-ID: <004901cdc5f2$1032e1e0$3098a5a0$%han@samsung.com> (raw)
In-Reply-To: <1353094271.2512.15.camel@joe-AO722>

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@perches.com>


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

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



      reply	other threads:[~2012-11-19  1:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20121030211530.09F1320004E@hpza10.eem.corp.google.com>
2012-11-16  6:21 ` [PATCH] checkpatch: extend line continuation test Joe Perches
2012-11-16  6:28   ` Jingoo Han
2012-11-16  7:02   ` Geert Uytterhoeven
2012-11-16  7:09     ` Joe Perches
2012-11-16 19:31   ` [PATCH V2] " Joe Perches
2012-11-19  1:06     ` Jingoo Han [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='004901cdc5f2$1032e1e0$3098a5a0$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    /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