The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/1] checkpatch: Ignore <inttypes.h> format macros
@ 2026-05-11 12:12 Petr Vorel
  2026-05-11 13:37 ` Simon Glass
  2026-05-11 18:54 ` Joe Perches
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2026-05-11 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Petr Vorel, Joe Perches, Simon Glass, Dwaipayan Ray,
	Lukas Bulwahn, Przemek Kitszel

Constants from <inttypes.h> are used only in userspace tools, they are
from ISO C99, let's don't report it:

    arch/mips/boot/tools/relocs.c:572: CHECK: Avoid CamelCase: <PRIx32>
    arch/s390/tools/relocs.c:52: CHECK: Avoid CamelCase: <PRIu64>
    tools/testing/selftests/mm/vm_util.c:244: CHECK: Avoid CamelCase: <SCNu64>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3727156e4ccad..4c7a952a418c0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5940,6 +5940,8 @@ sub process {
 #Ignore SI style variants like nS, mV and dB
 #(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
 			    $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
+#Ignore <inttypes.h> format macros (e.g. PRIu64, SCNu64)
+			    $var !~ /^(?:PRI|SCN)[dioux][A-Z0-9]+$/ &&
 #Ignore some three character SI units explicitly, like MiB and KHz
 			    $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
 				while ($var =~ m{\b($Ident)}g) {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-11 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 12:12 [PATCH 1/1] checkpatch: Ignore <inttypes.h> format macros Petr Vorel
2026-05-11 13:37 ` Simon Glass
2026-05-11 20:55   ` Petr Vorel
2026-05-11 18:54 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox