summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2025-10-06 14:33:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:34:35 -0500
commit12cdc3738172825f7a26ffe82cf1437cfdf87735 (patch)
tree3d2f5d9c792118ace478d6b6b3a765da27c24e43 /usr
parent328ddff9ab058f689c28c740a0dad7b4fb7b94ae (diff)
downloadlinux-12cdc3738172825f7a26ffe82cf1437cfdf87735.tar.gz
linux-12cdc3738172825f7a26ffe82cf1437cfdf87735.tar.bz2
linux-12cdc3738172825f7a26ffe82cf1437cfdf87735.zip
kbuild: uapi: Strip comments before size type check
[ Upstream commit 66128f4287b04aef4d4db9bf5035985ab51487d5 ] On m68k, check_sizetypes in headers_check reports: ./usr/include/asm/bootinfo-amiga.h:17: found __[us]{8,16,32,64} type without #include <linux/types.h> This header file does not use any of the Linux-specific integer types, but merely refers to them from comments, so this is a false positive. As of commit c3a9d74ee413bdb3 ("kbuild: uapi: upgrade check_sizetypes() warning to error"), this check was promoted to an error, breaking m68k all{mod,yes}config builds. Fix this by stripping simple comments before looking for Linux-specific integer types. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Link: https://patch.msgid.link/949f096337e28d50510e970ae3ba3ec9c1342ec0.1759753998.git.geert@linux-m68k.org [nathan: Adjust comment and remove unnecessary escaping from slashes in regex] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'usr')
-rwxr-xr-xusr/include/headers_check.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr/include/headers_check.pl b/usr/include/headers_check.pl
index b6aec5e4365f..682980781eb3 100755
--- a/usr/include/headers_check.pl
+++ b/usr/include/headers_check.pl
@@ -160,6 +160,8 @@ sub check_sizetypes
if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
check_include_typesh($included);
}
+ # strip single-line comments, as types may be referenced within them
+ $line =~ s@/\*.*?\*/@@;
if ($line =~ m/__[us](8|16|32|64)\b/) {
printf STDERR "$filename:$lineno: " .
"found __[us]{8,16,32,64} type " .