Skip to content

Commit 66128f4

Browse files
geertunathanchance
authored andcommitted
kbuild: uapi: Strip comments before size type check
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 c3a9d74 ("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>
1 parent 2ea77fc commit 66128f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

usr/include/headers_check.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ sub check_sizetypes
155155
if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
156156
check_include_typesh($included);
157157
}
158+
# strip single-line comments, as types may be referenced within them
159+
$line =~ s@/\*.*?\*/@@;
158160
if ($line =~ m/__[us](8|16|32|64)\b/) {
159161
printf STDERR "$filename:$lineno: " .
160162
"found __[us]{8,16,32,64} type " .

0 commit comments

Comments
 (0)