summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/Makefile4
-rw-r--r--usr/include/Makefile11
-rwxr-xr-xusr/include/headers_check.pl63
3 files changed, 4 insertions, 74 deletions
diff --git a/usr/Makefile b/usr/Makefile
index f1779496bca7..e8f42478a0b7 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -16,6 +16,8 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
$(obj)/initramfs_data.o: $(obj)/initramfs_inc_data
+hostprogs := gen_init_cpio
+
ramfs-input := $(CONFIG_INITRAMFS_SOURCE)
cpio-data :=
@@ -48,8 +50,6 @@ ifeq ($(cpio-data),)
cpio-data := $(obj)/initramfs_data.cpio
-hostprogs := gen_init_cpio
-
# .initramfs_data.cpio.d is used to identify all files included
# in initramfs and to detect if any files are added/removed.
# Removed files are identified by directory timestamp being updated
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 61a7dd4fc05f..d8a508042fed 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -6,16 +6,9 @@
#
# -std=c90 (equivalent to -ansi) catches the violation of those.
# We cannot go as far as adding -Wpedantic since it emits too many warnings.
-UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
+UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declaration
-# In theory, we do not care -m32 or -m64 for header compile tests.
-# It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64.
-UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
-
-# USERCFLAGS might contain sysroot location for CC.
-UAPI_CFLAGS += $(USERCFLAGS)
-
-override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
+override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
# The following are excluded for now because they fail to build.
#
diff --git a/usr/include/headers_check.pl b/usr/include/headers_check.pl
index 1fbc8785f96e..af5a513eaa00 100755
--- a/usr/include/headers_check.pl
+++ b/usr/include/headers_check.pl
@@ -39,7 +39,6 @@ foreach my $file (@files) {
$lineno++;
&check_include();
&check_asm_types();
- &check_sizetypes();
&check_declarations();
# Dropped for now. Too much noise &check_config();
}
@@ -103,65 +102,3 @@ sub check_asm_types
$ret = 1;
}
}
-
-my $linux_types;
-my %import_stack = ();
-sub check_include_typesh
-{
- my $path = $_[0];
- my $import_path;
-
- my $fh;
- my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path);
- for my $possible ( @file_paths ) {
- if (not $import_stack{$possible} and open($fh, '<', $possible)) {
- $import_path = $possible;
- $import_stack{$import_path} = 1;
- last;
- }
- }
- if (eof $fh) {
- return;
- }
-
- my $line;
- while ($line = <$fh>) {
- if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
- $linux_types = 1;
- last;
- }
- if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
- check_include_typesh($included);
- }
- }
- close $fh;
- delete $import_stack{$import_path};
-}
-
-sub check_sizetypes
-{
- if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) {
- return;
- }
- if ($lineno == 1) {
- $linux_types = 0;
- } elsif ($linux_types >= 1) {
- return;
- }
- if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
- $linux_types = 1;
- return;
- }
- 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 " .
- "without #include <linux/types.h>\n";
- $linux_types = 2;
- $ret = 1;
- }
-}