linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Chris Down <chris@chrisdown.name>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] checkpatch: Don't warn about colon termination in linker scripts
Date: Fri, 05 Feb 2021 19:25:06 -0800	[thread overview]
Message-ID: <90cf805f4be6ecf5887fe470af6db2d596dc46a3.camel@perches.com> (raw)
In-Reply-To: <YBwhqsc2TIVeid3t@chrisdown.name>

On Thu, 2021-02-04 at 16:32 +0000, Chris Down wrote:
> This check erroneously flags cases like the one in my recent printk
> enumeration patch[0], where the spaces are syntactic, and `section:' vs.
> `section :' is syntactically important:
> 
>     ERROR: space prohibited before that ':' (ctx:WxW)
>     #258: FILE: include/asm-generic/vmlinux.lds.h:314:
>     +       .printk_fmts : AT(ADDR(.printk_fmts) - LOAD_OFFSET) {
> 
> 0: https://lore.kernel.org/patchwork/patch/1375749/

Remember to cc the checkpatch maintainers.

> Signed-off-by: Chris Down <chris@chrisdown.name>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4f8494527139..3bcffc5574ae 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5046,7 +5046,7 @@ sub process {
>  				# A colon needs no spaces before when it is
>  				# terminating a case value or a label.
>  				} elsif ($opv eq ':C' || $opv eq ':L') {
> -					if ($ctx =~ /Wx./) {
> +					if ($ctx =~ /Wx./ and $realfile !~ m@.*\.lds\.h$@) {
>  						if (ERROR("SPACING",
>  							  "space prohibited before that '$op' $at\n" . $hereptr)) {
>  							$good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]);



  reply	other threads:[~2021-02-06  4:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 16:32 [PATCH] checkpatch: Don't warn about colon termination in linker scripts Chris Down
2021-02-06  3:25 ` Joe Perches [this message]
2021-02-06 13:04   ` Chris Down
2021-02-06 13:11     ` Joe Perches

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=90cf805f4be6ecf5887fe470af6db2d596dc46a3.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chrisdown.name \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).