* [PATCH] checkpatch: add NOKPROBE_SYMBOL to the whitelist of lines that can occur immediately after functions
@ 2026-08-10 16:57 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Paul Walmsley @ 2026-08-07 1:00 UTC (permalink / raw)
To: apw, joe, linux-kernel; +Cc: Nam Cao, Jisheng Zhang
It's customary for NOKPROBE_SYMBOL() macro usage to appear immedately
after a function's final closing brace, but checkpatch doesn't know
that yet. As a result, checkpatch --strict incorrectly flags this
common kernel pattern, e.g.,
CHECK: Please use a blank line after function/struct/union/enum declarations
33: FILE: arch/riscv/kernel/traps.c:273:
}
+NOKPROBE_SYMBOL(probe_single_step_handler);
Fix by adding NOKPROBE_SYMBOL to the whitelist of patterns that are
cleared to appear immediately after functions.
Cc: Nam Cao <namcao@linutronix.de>
Cc: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..f8a57ed71f34 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4148,6 +4148,7 @@ sub process {
$line =~ /^\+[a-z_]*init/ ||
$line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ ||
$line =~ /^\+\s*DECLARE/ ||
+ $line =~ /^\+\s*NOKPROBE_SYMBOL/ ||
$line =~ /^\+\s*builtin_[\w_]*driver/ ||
$line =~ /^\+\s*__setup/)) {
if (CHK("LINE_SPACING",
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] checkpatch: add NOKPROBE_SYMBOL to the whitelist of lines that can occur immediately after functions
@ 2026-08-10 16:57 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2026-08-10 16:57 UTC (permalink / raw)
To: pjw, apw, joe, linux-kernel; +Cc: jszhang, namcao, Andrew Morton, Petr Vorel
From: Paul Walmsley <pjw@kernel.org>
> It's customary for NOKPROBE_SYMBOL() macro usage to appear immedately
> after a function's final closing brace, but checkpatch doesn't know
> that yet. As a result, checkpatch --strict incorrectly flags this
> common kernel pattern, e.g.,
> CHECK: Please use a blank line after function/struct/union/enum declarations
> 33: FILE: arch/riscv/kernel/traps.c:273:
> }
> +NOKPROBE_SYMBOL(probe_single_step_handler);
> Fix by adding NOKPROBE_SYMBOL to the whitelist of patterns that are
> cleared to appear immediately after functions.
> Cc: Nam Cao <namcao@linutronix.de>
> Cc: Jisheng Zhang <jszhang@kernel.org>
> Signed-off-by: Paul Walmsley <pjw@kernel.org>
> ---
> scripts/checkpatch.pl | 1 +
> 1 file changed, 1 insertion(+)
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b7a42bbdd94..f8a57ed71f34 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4148,6 +4148,7 @@ sub process {
> $line =~ /^\+[a-z_]*init/ ||
> $line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ ||
> $line =~ /^\+\s*DECLARE/ ||
> + $line =~ /^\+\s*NOKPROBE_SYMBOL/ ||
> $line =~ /^\+\s*builtin_[\w_]*driver/ ||
> $line =~ /^\+\s*__setup/)) {
> if (CHK("LINE_SPACING",
+1
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] checkpatch: add NOKPROBE_SYMBOL to the whitelist of lines that can occur immediately after functions
2026-08-10 16:57 ` Petr Vorel
(?)
@ 2026-08-07 1:17 ` Joe Perches
-1 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2026-08-07 1:17 UTC (permalink / raw)
To: Paul Walmsley, apw, linux-kernel, Andrew Morton; +Cc: Nam Cao, Jisheng Zhang
On Thu, 2026-08-06 at 19:00 -0600, Paul Walmsley wrote:
> It's customary for NOKPROBE_SYMBOL() macro usage to appear immedately
immediate typo.
Andrew can you please fix it when applying?
Anyway, this is completely sensible, thanks.
Acked-by: Joe Perches <joe@perches.com>
> after a function's final closing brace, but checkpatch doesn't know
> that yet. As a result, checkpatch --strict incorrectly flags this
> common kernel pattern, e.g.,
>
> CHECK: Please use a blank line after function/struct/union/enum declarations
> 33: FILE: arch/riscv/kernel/traps.c:273:
> }
> +NOKPROBE_SYMBOL(probe_single_step_handler);
>
> Fix by adding NOKPROBE_SYMBOL to the whitelist of patterns that are
> cleared to appear immediately after functions.
>
> Cc: Nam Cao <[namcao@linutronix.de](mailto:namcao@linutronix.de)>
> Cc: Jisheng Zhang <[jszhang@kernel.org](mailto:jszhang@kernel.org)>
> Signed-off-by: Paul Walmsley <[pjw@kernel.org](mailto:pjw@kernel.org)>
> ---
> scripts/checkpatch.pl | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b7a42bbdd94..f8a57ed71f34 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4148,6 +4148,7 @@ sub process {
> $line =~ /^\+[a-z_]*init/ ||
> $line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ ||
> $line =~ /^\+\s*DECLARE/ ||
> + $line =~ /^\+\s*NOKPROBE_SYMBOL/ ||
> $line =~ /^\+\s*builtin_[\w_]*driver/ ||
> $line =~ /^\+\s*__setup/)) {
> if (CHK("LINE_SPACING",
>
> ```
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-10 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 1:00 [PATCH] checkpatch: add NOKPROBE_SYMBOL to the whitelist of lines that can occur immediately after functions Paul Walmsley
2026-08-10 16:57 ` Petr Vorel
2026-08-07 1:17 ` Joe Perches
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.