Skip to content

Commit 2d7eda1

Browse files
nathanchanceNicolas Schier
authored andcommitted
kbuild: uapi: Drop types.h check from headers_check.pl
Since commit d6fc9fc ("kbuild: compile-test exported headers to ensure they are self-contained"), the UAPI headers are compile tested standalone with the compiler. This compile testing will catch a missing include of types.h, making the types.h checking in headers_check.pl originally added in commit 483b412 ("kbuild: add checks for include of linux/types in userspace headers") obsolete. Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Thomas Weißschuh <[email protected]> Link: https://patch.msgid.link/20251023-headers-pl-drop-check-sizes-v1-1-18bd21cf8f5e@kernel.org Signed-off-by: Nicolas Schier <[email protected]>
1 parent 7319256 commit 2d7eda1

File tree

1 file changed

+0
-63
lines changed

1 file changed

+0
-63
lines changed

usr/include/headers_check.pl

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
$lineno++;
4040
&check_include();
4141
&check_asm_types();
42-
&check_sizetypes();
4342
&check_declarations();
4443
# Dropped for now. Too much noise &check_config();
4544
}
@@ -103,65 +102,3 @@ sub check_asm_types
103102
$ret = 1;
104103
}
105104
}
106-
107-
my $linux_types;
108-
my %import_stack = ();
109-
sub check_include_typesh
110-
{
111-
my $path = $_[0];
112-
my $import_path;
113-
114-
my $fh;
115-
my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path);
116-
for my $possible ( @file_paths ) {
117-
if (not $import_stack{$possible} and open($fh, '<', $possible)) {
118-
$import_path = $possible;
119-
$import_stack{$import_path} = 1;
120-
last;
121-
}
122-
}
123-
if (eof $fh) {
124-
return;
125-
}
126-
127-
my $line;
128-
while ($line = <$fh>) {
129-
if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
130-
$linux_types = 1;
131-
last;
132-
}
133-
if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
134-
check_include_typesh($included);
135-
}
136-
}
137-
close $fh;
138-
delete $import_stack{$import_path};
139-
}
140-
141-
sub check_sizetypes
142-
{
143-
if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) {
144-
return;
145-
}
146-
if ($lineno == 1) {
147-
$linux_types = 0;
148-
} elsif ($linux_types >= 1) {
149-
return;
150-
}
151-
if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
152-
$linux_types = 1;
153-
return;
154-
}
155-
if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
156-
check_include_typesh($included);
157-
}
158-
# strip single-line comments, as types may be referenced within them
159-
$line =~ s@/\*.*?\*/@@;
160-
if ($line =~ m/__[us](8|16|32|64)\b/) {
161-
printf STDERR "$filename:$lineno: " .
162-
"found __[us]{8,16,32,64} type " .
163-
"without #include <linux/types.h>\n";
164-
$linux_types = 2;
165-
$ret = 1;
166-
}
167-
}

0 commit comments

Comments
 (0)