mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: jim.cromie@gmail.com, Arnd Bergmann <arnd@arndb.de>,
	Jason Baron	 <jbaron@akamai.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Petr Pavlu	 <petr.pavlu@suse.com>,
	Daniel Gomez <da.gomez@kernel.org>,
	Sami Tolvanen	 <samitolvanen@google.com>,
	Aaron Tomlin <atomlin@atomlin.com>,
	Andrew Morton	 <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	 linux-modules@vger.kernel.org
Subject: Re: [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions
Date: Sat, 21 Nov 2026 18:27:45 -0800	[thread overview]
Message-ID: <a6fdcd6d4bce5ace3b4e34d1393f5cfe58e17c0d.camel@perches.com> (raw)
In-Reply-To: <20261121-vmlinux-lds-v1-6-49818f3f5cc0@gmail.com>

On Sat, 2026-11-21 at 15:49 -0700, Jim Cromie via B4 Relay wrote:
> From: Jim Cromie <jim.cromie@gmail.com>
> 
> checkpatch skips macro-rule checks in linker scripts; 3 of them
> explicitly check for vmlinux.lds.h, and 1 (the 1st) skips on any
> *.lds.h.  Generalize the 3 to match the 1st, including the escapes on
> the dots, so they're literal checks for '.'

Please remember to email the checkpatch maintainer too.

> 
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
> ---
>  scripts/checkpatch.pl | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b8b64f720191..318e1f2577fd 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -6016,7 +6016,7 @@ sub process {
>  # Usually multi-statement macros should be enclosed in a do {} while
>  # (0) loop.  Grab the first statement and ensure its the whole macro
>  # if its not enclosed in a known good container
> -		if ($realfile !~ m@/vmlinux.lds.h$@ &&
> +		if ($realfile !~ m@/\.lds\.h$@ &&

Probably better to have something like
my $is_linker_file = '\.lds\.h$';
or maybe
my $is_linker_file = '\Q.lds.h\E$';

and use that everywhere

> @@ -6175,7 +6175,7 @@ sub process {
>  
>  # check for line continuations outside of #defines, preprocessor #, and asm
>  
> -		} elsif ($realfile =~ m@/vmlinux.lds.h$@) {
> +		} elsif ($realfile =~ m@/\.lds\.h$@) {

>  		    $line =~ s/(\w+)/$maybe_linker_symbol{$1}++/ge;
>  		    #print "REAL: $realfile\nln: $line\nkeys:", sort keys %maybe_linker_symbol;
>  		} else {
> @@ -6192,7 +6192,7 @@ sub process {
>  # single-statement macros do not need to be enclosed in do while (0) loop,
>  # macro should not end with a semicolon
>  		if ($perl_version_ok &&
> -		    $realfile !~ m@/vmlinux.lds.h$@ &&
> +		    $realfile !~ m@/\.lds\.h$@ &&
>  		    $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) {
>  			my $ln = $linenr;
>  			my $cnt = $realcnt;

      reply	other threads:[~2026-11-22  2:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 22:49 [PATCH 0/6] dyndbg,vmlinux.lds.h: fix i386 section alignment in BOUNDED_SECTION macros Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 1/6] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 2/6] vmlinux.lds.h: drop unused HEADERED_SECTION* macros Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 3/6] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 4/6] vmlinux.lds.h: remove redundant ALIGN(8) directives Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 5/6] dyndbg.lds.S: fix lost dyndbg sections in modules Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions Jim Cromie via B4 Relay
2026-11-22  2:27   ` 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=a6fdcd6d4bce5ace3b4e34d1393f5cfe58e17c0d.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=atomlin@atomlin.com \
    --cc=da.gomez@kernel.org \
    --cc=jbaron@akamai.com \
    --cc=jim.cromie@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.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

all inboxes | Powered by JetHome®