summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPetr Vorel <pvorel@suse.cz>2026-09-04 13:02:28 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-10-10 18:56:45 -0700
commit3dc89677fbba48e10653cff2c7a8972b62eb22fd (patch)
tree912c4f2aea7de018a60c17fa1691224f36fe13c8 /scripts
parent15c6173efb9238795e0632b081912c060701a553 (diff)
downloadlinux-next-3dc89677fbba48e10653cff2c7a8972b62eb22fd.tar.gz
linux-next-3dc89677fbba48e10653cff2c7a8972b62eb22fd.zip
checkpatch: ignore <inttypes.h> format macros for userspace tools
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> Link: https://lore.kernel.org/20260904110230.1219037-3-pvorel@suse.cz Signed-off-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b8702f6bc9b5..b458c7f22684 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5950,6 +5950,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)
+ (is_userspace($realfile) ? $var !~ /^(?:PRI|SCN)[dioux][A-Z0-9]+$/ : 1) &&
#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) {