All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: 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, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions
Date: Sat, 21 Nov 2026 15:49:24 -0700	[thread overview]
Message-ID: <20261121-vmlinux-lds-v1-6-49818f3f5cc0@gmail.com> (raw)
In-Reply-To: <20261121-vmlinux-lds-v1-0-49818f3f5cc0@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 '.'

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$@ &&
 		    $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
 			my $ln = $linenr;
 			my $cnt = $realcnt;
@@ -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;

-- 
2.56.1


WARNING: multiple messages have this Message-ID (diff)
From: Jim Cromie via B4 Relay <devnull+jim.cromie.gmail.com@kernel.org>
To: 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, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions
Date: Sat, 21 Nov 2026 15:49:24 -0700	[thread overview]
Message-ID: <20261121-vmlinux-lds-v1-6-49818f3f5cc0@gmail.com> (raw)
In-Reply-To: <20261121-vmlinux-lds-v1-0-49818f3f5cc0@gmail.com>

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 '.'

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$@ &&
 		    $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
 			my $ln = $linenr;
 			my $cnt = $realcnt;
@@ -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;

-- 
2.56.1



  parent reply	other threads:[~2026-11-21 22:49 UTC|newest]

Thread overview: 21+ 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
2026-11-21 22:49 ` 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
2026-11-21 22:49   ` Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 2/6] vmlinux.lds.h: drop unused HEADERED_SECTION* macros Jim Cromie
2026-11-21 22:49   ` Jim Cromie via B4 Relay
2026-11-22 11:54   ` David Laight
2026-11-23 18:12     ` jim.cromie
2026-11-21 22:49 ` [PATCH 3/6] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 Jim Cromie
2026-11-21 22:49   ` Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 4/6] vmlinux.lds.h: remove redundant ALIGN(8) directives Jim Cromie
2026-11-21 22:49   ` Jim Cromie via B4 Relay
2026-11-21 22:49 ` [PATCH 5/6] dyndbg.lds.S: fix lost dyndbg sections in modules Jim Cromie
2026-11-21 22:49   ` Jim Cromie via B4 Relay
2026-11-21 22:49 ` Jim Cromie [this message]
2026-11-21 22:49   ` [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions Jim Cromie via B4 Relay
2026-11-21 22:54   ` sashiko-bot
2026-11-22  2:27   ` Joe Perches
2026-11-23 18:15     ` jim.cromie
2026-11-22 12:02 ` [PATCH 0/6] dyndbg,vmlinux.lds.h: fix i386 section alignment in BOUNDED_SECTION macros David Laight
2026-11-23 18:08   ` jim.cromie

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=20261121-vmlinux-lds-v1-6-49818f3f5cc0@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=atomlin@atomlin.com \
    --cc=da.gomez@kernel.org \
    --cc=jbaron@akamai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.