From: sashiko-bot@kernel.org
To: "Jim Cromie" <jim.cromie@gmail.com>
Cc: linux-modules@vger.kernel.org, "Petr Pavlu" <petr.pavlu@suse.com>
Subject: Re: [PATCH 6/6] checkpatch.pl: generalize linker script macro exceptions
Date: Sat, 21 Nov 2026 22:54:21 +0000 [thread overview]
Message-ID: <sashiko-outbox-227475@kernel.org> (raw)
In-Reply-To: <20261121-vmlinux-lds-v1-6-49818f3f5cc0@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] checkpatch: literal slash in regex in process() breaks
*.lds.h matching
--
commit 1481804dada7e62db737a08856db566e01d7b6bb
Author: Jim Cromie <jim.cromie@gmail.com>
checkpatch.pl: generalize linker script macro exceptions
This commit replaces three explicit vmlinux.lds.h path checks in process()
with a pattern intended to match any *.lds.h linker script header.
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b8b64f7201915..318e1f2577fd4 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;
[Severity: Medium]
Does m@/\.lds\.h$@ fail to match vmlinux.lds.h and other *.lds.h files?
Because m@...@ uses @ as the regex delimiter, the leading / is matched as
a literal path separator, so the pattern only matches a file literally
named .lds.h. As a result, this regression causes checkpatch to stop
excluding vmlinux.lds.h and other *.lds.h headers from macro and line
continuation checks (unlike the earlier m@.*\.lds\.h$@ check in
process()).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261121-vmlinux-lds-v1-0-49818f3f5cc0@gmail.com?part=6
prev parent reply other threads:[~2026-11-21 22:54 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-21 22:54 ` sashiko-bot [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=sashiko-outbox-227475@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jim.cromie@gmail.com \
--cc=linux-modules@vger.kernel.org \
--cc=petr.pavlu@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
/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