linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/27] Compile test and fixes for exported header files
       [not found] <1408660449-4011-1-git-send-email-mikko.rapeli@iki.fi>
@ 2014-09-01  6:25 ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 01/27] Compile test script " Mikko Rapeli
                     ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

This patch series introduces a simple compile test for exported header files
and fixes a few example findings from the test.

It's a bit of a pain to see headers in userspace with unknown kernel
definitions, incomplete header file dependencies and other compile failures.

The test was simple until I found out that some kernel headers depend on
gcc and libc headers.  Now there's a hack to copy libc headers and hard coded
path to gcc headers for the tests but hopefully in further iterations I can
make this more portable. Maybe there's a chance that a test like this
could be added into 'headers_chech_all' or even 'headers_install'.
Further uses for compiling headers might be ABI checkers but I've not
explored this any further.

The fixed issues are just a few samples I've been able to fix so far.
I'm hoping to get some feedback if fixes or the tests are doing something
completely wrong. Some problems like with via_drm.h seem several years old but
have not been fixed thus far:

http://marc.info/?l=linux-kbuild&m=122919682002000&w=2

Mikko Rapeli (27):
  Compile test script for exported header files
  scripts/headers.sh: add verbose option to make calls if defined
  Makefile: propagate verbose options
  headers_install.sh: enhance error handling
  drm.h: include stdlib.h in userspace
  drm_mode.h: include stdint.h and linux/types.h in userspace
  exynos_drm.h: include stdint.h in userspace
  nouveau_drm.h: include stdint.h in userspace
  radeon_drm.h: include stdint.h in userspace
  vmwgfx_drm.h: include drm/drm.h instead of drm.h in userspace
  dm-log-userspace.h: include stdint.h in userspace
  hsi_char.h: include stdint.h in userspace
  ebtables.h: include stdint.h in userspace
  cld.h: include stdint.h in userspace
  rds.h: include stdint.h in userspace
  sctp.h: include stdint.h in userspace
  scsi_bsg_fc.h: include stdint.h in userspace
  scsi_netlink.h: include stdint.h in userspace
  scsi_netlink_fc.h: include stdint.h in userspace
  hdspm.h: include stdint.h in userspace
  gntalloc.h: include stdint.h in userspace
  gntdev.h: include stdint.h in userspace
  r128_drm.h: include drm/drm.h
  via_drm.h: include linux/types.h instead of non-existing
    via_drmclient.h
  via_drm.h: hide struct via_file_private in userspace
  savage_drm.h: include <drm/drm.h>
  sis_drm.h: hide sis_file_private in userspace

 Makefile                                       |  8 +--
 include/uapi/drm/drm.h                         |  4 ++
 include/uapi/drm/drm_mode.h                    |  5 ++
 include/uapi/drm/exynos_drm.h                  |  5 ++
 include/uapi/drm/nouveau_drm.h                 |  6 ++
 include/uapi/drm/r128_drm.h                    |  2 +
 include/uapi/drm/radeon_drm.h                  |  5 ++
 include/uapi/drm/savage_drm.h                  |  2 +
 include/uapi/drm/sis_drm.h                     |  2 +
 include/uapi/drm/via_drm.h                     |  6 +-
 include/uapi/drm/vmwgfx_drm.h                  |  2 +-
 include/uapi/linux/dm-log-userspace.h          |  5 ++
 include/uapi/linux/hsi/hsi_char.h              |  7 ++-
 include/uapi/linux/netfilter_bridge/ebtables.h |  5 ++
 include/uapi/linux/nfsd/cld.h                  |  6 ++
 include/uapi/linux/rds.h                       |  4 ++
 include/uapi/linux/sctp.h                      |  4 ++
 include/uapi/scsi/scsi_bsg_fc.h                |  6 ++
 include/uapi/scsi/scsi_netlink.h               |  6 +-
 include/uapi/scsi/scsi_netlink_fc.h            |  5 ++
 include/uapi/sound/hdspm.h                     |  6 ++
 include/uapi/xen/gntalloc.h                    |  6 ++
 include/uapi/xen/gntdev.h                      |  6 ++
 scripts/headers.sh                             |  2 +-
 scripts/headers_compile_test.sh                | 84 ++++++++++++++++++++++++++
 scripts/headers_install.sh                     | 15 +++--
 26 files changed, 198 insertions(+), 16 deletions(-)
 create mode 100755 scripts/headers_compile_test.sh

-- 
2.1.0


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 01/27] Compile test script for exported header files
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 02/27] scripts/headers.sh: add verbose option to make calls if defined Mikko Rapeli
                     ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Users of kernel header files would be happier if they did not contain
kernel specific parts and would contain #include statements for all
other header files that they depend on, and in general would compile.

For each header file exported to userspace, the script creates
a simple .c file which just includes the header file. Then it
tries to compile it and reports results.

Kernel headers depend on GCC headers so their path is included in
the compiler command line.

Some gcc and kernel headers depend on libc headers so make them available
by copying from the running system. The /usr/include location can not be
used directly since it may contain an older version of the kernel headers.

Execute the script like this on x86 GNU/Linux machine with GCC headers in
/usr/lib/gcc/i586-linux-gnu/4.9/include and libc headers in /usr/include:

$ make headers_install
$ cd usr/include
$ ../../scripts/headers_compile_test.sh

Example statistics from 3.15.9 kernel:

131 files failed the compile test.
597 files passed the compile test.

Example error count from 3.15.9:

$ ../../scripts/headers_compile_test.sh 2>&1 | \
grep error: | sed -e 's/.*error://g' | sort | uniq -c | sort -rn

    256  unknown type name ‘uint32_t’
    115  unknown type name ‘uint64_t’
    103  unknown type name ‘size_t’
     43  unknown type name ‘__kernel_ulong_t’
     36  unknown type name ‘uint8_t’
     22  field ‘addr’ has incomplete type
     18  field ‘tstamp’ has incomplete type
     16  unknown type name ‘__kernel_time_t’
     16  field ‘in’ has incomplete type
     16  field ‘in6’ has incomplete type
     14  unknown type name ‘__be16’
     13  ‘IFNAMSIZ’ undeclared here (not in a function)
      9  unknown type name ‘uint16_t’
      9  field ‘ifru_netmask’ has incomplete type
      9  field ‘ifru_hwaddr’ has incomplete type
      9  field ‘ifru_dstaddr’ has incomplete type
      9  field ‘ifru_broadaddr’ has incomplete type
      9  field ‘ifru_addr’ has incomplete type
      8  unknown type name ‘__kernel_pid_t’
      7  unknown type name ‘u_short’
      7  unknown type name ‘pid_t’
      6  invalid application of ‘sizeof’ to incomplete type ‘struct timespec’
      6  field ‘audio_tstamp’ has incomplete type
      5  unknown type name ‘__kernel_long_t’
      5  requested alignment is not an integer constant
      5  limits.h: No such file or directory
      5  array type has incomplete element type
      4  unknown type name ‘__kernel_uid32_t’
      4  unknown type name ‘__kernel_gid32_t’
      4  unknown type name ‘int32_t’
      4  field ‘src’ has incomplete type
      4  ‘ETH_ALEN’ undeclared here (not in a function)
      3  unknown type name ‘int64_t’
      3  unknown type name ‘caddr_t’
      3  ‘IPSET_ERR_TYPE_SPECIFIC’ undeclared here (not in a function)
      3  field ‘trigger_tstamp’ has incomplete type
      3  field ‘src_addr’ has incomplete type
      3  field ‘smsk’ has incomplete type
      3  field ‘sin_addr’ has incomplete type
      3  field ‘laddr’ has incomplete type
      3  field ‘id’ has incomplete type
      3  field ‘bssid’ has incomplete type
      3  expected specifier-qualifier-list before ‘uint64_t’
      2  unknown type name ‘u_long’
      2  unknown type name ‘stack_t’
      2  unknown type name ‘sigset_t’
      2  unknown type name ‘sa_family_t’
      2  unknown type name ‘__kernel_mode_t’
      2  unknown type name ‘__kernel_key_t’
      2  unknown type name ‘elf_gregset_t’
      2  unknown type name ‘bool’
      2  ‘uint64_t’ undeclared here (not in a function)
      2  ‘true’ undeclared (first use in this function)
      2  ‘NAME_MAX’ undeclared here (not in a function)
      2  ‘__kernel_mode_t’ undeclared here (not in a function)
      2  field ‘uc_mcontext’ has incomplete type
      2  field ‘tmsk’ has incomplete type
      2  field ‘tgt’ has incomplete type
      2  field ‘shm_perm’ has incomplete type
      2  field ‘sem_perm’ has incomplete type
      2  field ‘raddr’ has incomplete type
      2  field ‘msg_perm’ has incomplete type
      2  field ‘grp’ has incomplete type
      2  field ‘dst_addr’ has incomplete type
      2  field ‘arp_pa’ has incomplete type
      2  field ‘arp_netmask’ has incomplete type
      2  field ‘arp_ha’ has incomplete type
      2  ‘false’ undeclared (first use in this function)
      1  xen/interface/xen.h: No such file or directory
      1  via_drmclient.h: No such file or directory
      1  unknown type name ‘wait_queue_head_t’
      1  unknown type name ‘u_int8_t’
      1  unknown type name ‘snd_seq_client_type_t’
      1  unknown type name ‘int16_t’
      1  unknown type name ‘ino_t’
      1  unknown type name ‘elf_greg_t’
      1  unknown type name ‘elf_fpxregset_t’
      1  unknown type name ‘elf_fpregset_t’
      1  unknown type name ‘__be32’
      1  ‘SIOCDEVPRIVATE’ undeclared here (not in a function)
      1  ‘NULL’ undeclared (first use in this function)
      1  netinet/in.h: No such file or directory
      1  ‘MSG_FIN’ undeclared here (not in a function)
      1  ‘MAX_IPOPTLEN’ undeclared here (not in a function)
      1  ‘MAX_ADDR_LEN’ undeclared here (not in a function)
      1  invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’
      1  ‘IFHWADDRLEN’ undeclared here (not in a function)
      1  field ‘vmask’ has incomplete type
      1  field ‘vifc_rmt_addr’ has incomplete type
      1  field ‘vifc_lcl_addr’ has incomplete type
      1  field ‘vaddr’ has incomplete type
      1  field ‘uc_chain’ has incomplete type
      1  field ‘tgt_ip’ has incomplete type
      1  field ‘tcp’ has incomplete type
      1  field ‘sw_reserved’ has incomplete type
      1  field ‘stamp’ has incomplete type
      1  field ‘sspp_addr’ has incomplete type
      1  field ‘ssp_addr’ has incomplete type
      1  field ‘src_mask’ has incomplete type
      1  field ‘src_ip’ has incomplete type
      1  field ‘spt_address’ has incomplete type
      1  field ‘spp_address’ has incomplete type
      1  field ‘spinfo_address’ has incomplete type
      1  field ‘spc_aaddr’ has incomplete type
      1  field ‘sas_obs_rto_ipaddr’ has incomplete type
      1  field ‘saddr’ has incomplete type
      1  field ‘rtmsg_src’ has incomplete type
      1  field ‘rtmsg_gateway’ has incomplete type
      1  field ‘rtmsg_dst’ has incomplete type
      1  field ‘rt_genmask’ has incomplete type
      1  field ‘rt_gateway’ has incomplete type
      1  field ‘rt_dst’ has incomplete type
      1  field ‘real’ has incomplete type
      1  field ‘prefix’ has incomplete type
      1  field ‘obj_list’ has incomplete type
      1  field ‘mfcc_origin’ has incomplete type
      1  field ‘mfcc_mcastgrp’ has incomplete type
      1  field ‘mf6cc_origin’ has incomplete type
      1  field ‘mf6cc_mcastgrp’ has incomplete type
      1  field ‘mask’ has incomplete type
      1  field ‘ival2’ has incomplete type
      1  field ‘ival1’ has incomplete type
      1  field ‘iph’ has incomplete type
      1  field ‘ip’ has incomplete type
      1  field ‘ip6’ has incomplete type
      1  field ‘im_src’ has incomplete type
      1  field ‘im_dst’ has incomplete type
      1  field ‘im6_src’ has incomplete type
      1  field ‘im6_dst’ has incomplete type
      1  field ‘gw’ has incomplete type
      1  field ‘expected’ has incomplete type
      1  field ‘dst_mask’ has incomplete type
      1  field ‘dmsk’ has incomplete type
      1  field ‘dest_addr’ has incomplete type
      1  field ‘daddr’ has incomplete type
      1  field ‘ap_addr’ has incomplete type
      1  field ‘a6’ has incomplete type
      1  field ‘a4’ has incomplete type
      1  expected specifier-qualifier-list before ‘DECLARE_BITMAP’
      1  expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘snd_seq_client_type_t’
      1  #error "patchkey.h included directly"
      1  drm.h: No such file or directory
      1  ‘DLM_RESNAME_MAXLEN’ undeclared here (not in a function)
      1  arpa/inet.h: No such file or directory

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 scripts/headers_compile_test.sh | 84 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100755 scripts/headers_compile_test.sh

diff --git a/scripts/headers_compile_test.sh b/scripts/headers_compile_test.sh
new file mode 100755
index 0000000..59f7032
--- /dev/null
+++ b/scripts/headers_compile_test.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+# bash due to arithmetics
+set -e
+set -u
+#set -x
+
+echo Simple compile test for header files meant for userspace.
+
+# sanity test
+if [ ! -d ./linux ]; then
+	echo Sanity check error: ./linux directory not found
+	echo Should be called in usr/include after \'make headers_install\'.
+	echo Returns number of failed files, 0 if none.
+	exit 1
+fi
+
+# Support CC variable for compiler and ccache
+set +u
+if [ "$CC"foobar == "foobar" ]; then
+	CC=cc
+fi
+set -u
+
+# Kernel headers refer to some gcc and libc headers so make them available.
+set +u
+if [ "$LIBC_ARCH"foobar == "foobar" ]; then
+	LIBC_ARCH=i386-linux-gnu
+fi
+
+if [ "$LIBC"foobar == "foobar" ]; then
+	LIBC=/usr/include
+fi
+set -u
+
+LIBC_INC=../libc_include
+rm -rf "$LIBC_INC"
+mkdir -p "$LIBC_INC"
+
+# just copy them all without subdirectories
+cp "$LIBC"/*.h "$LIBC_INC"/
+cp -a "$LIBC/$LIBC_ARCH" "$LIBC_INC/$LIBC_ARCH"
+
+# GCC headers
+set +u
+if [ "$GCC_INC"foobar == "foobar" ]; then
+	GCC_INC=/usr/lib/gcc/i586-linux-gnu/4.9/include
+fi
+set -u
+
+# For each header file, create a .c which just includes the header file
+# and try to compile it using only current directory for searching other
+# included header files.
+_FAILED=0
+_PASSED=0
+for f in $( find . -name "*\.h" | xargs ); do
+	_FAIL=0
+	CFILE=$( echo "$( dirname $f )/$( basename $f .h ).c" )
+
+	# create .c file
+	echo "#include <$( echo $f | sed -e 's|^.\/||' )>" \
+		> "$(dirname $f)/$(basename $f .h).c"
+
+	# compile test, CC not quoted to support ccache
+	echo $CC -Wall -c -nostdinc -I . -I "$LIBC_INC" -I "$LIBC_INC/$LIBC_ARCH" -I "$GCC_INC" "$CFILE"
+	$CC -Wall -c -nostdinc -I . -I "$LIBC_INC" -I "$LIBC_INC/$LIBC_ARCH" -I "$GCC_INC" "$CFILE" \
+		|| _FAIL=1
+
+	# report errors
+	if [ "$_FAIL" -gt 0 ]; then
+		echo "FAILED: $f"
+		_FAILED=$(( $_FAILED + 1 ))
+	else
+		echo "PASSED: $f"
+		_PASSED=$(( $_PASSED + 1))
+	fi
+done
+
+rm -rf "$LIBC_INC"
+
+echo Statistics:
+echo $_FAILED files failed the compile test.
+echo $_PASSED files passed the compile test.
+
+exit $_FAILED
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 02/27] scripts/headers.sh: add verbose option to make calls if defined
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 01/27] Compile test script " Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 03/27] Makefile: propagate verbose options Mikko Rapeli
                     ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Useful when debugging the scripts.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 scripts/headers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/headers.sh b/scripts/headers.sh
index 978b42b..09e8a5c 100755
--- a/scripts/headers.sh
+++ b/scripts/headers.sh
@@ -7,7 +7,7 @@ set -e
 do_command()
 {
 	if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
-		make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
+		make V=$KBUILD_VERBOSE ARCH=$2 KBUILD_HEADERS=$1 headers_$1
 	else
 		printf "Ignoring arch: %s\n" ${arch}
 	fi
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 03/27] Makefile: propagate verbose options
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 01/27] Compile test script " Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 02/27] scripts/headers.sh: add verbose option to make calls if defined Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 04/27] headers_install.sh: enhance error handling Mikko Rapeli
                     ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Usefull when debugging the make scripts.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 25b85ab..df0eb14 100644
--- a/Makefile
+++ b/Makefile
@@ -855,13 +855,13 @@ quiet_cmd_link-vmlinux = LINK    $@
 # execute if the rest of the kernel build went well.
 vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
 ifdef CONFIG_HEADERS_CHECK
-	$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
+	$(Q)$(MAKE) V=$(KBUILD_VERBOSE) -f $(srctree)/Makefile headers_check
 endif
 ifdef CONFIG_SAMPLES
-	$(Q)$(MAKE) $(build)=samples
+	$(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=samples
 endif
 ifdef CONFIG_BUILD_DOCSRC
-	$(Q)$(MAKE) $(build)=Documentation
+	$(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(build)=Documentation
 endif
 	+$(call if_changed,link-vmlinux)
 
@@ -1012,7 +1012,7 @@ headers_check_all: headers_install_all
 PHONY += headers_check
 headers_check: headers_install
 	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
-	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
+	$(Q)$(MAKE) V=$(KBUILD_VERBOSE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
 # Modules
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 04/27] headers_install.sh: enhance error handling
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (2 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 03/27] Makefile: propagate verbose options Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 05/27] drm.h: include stdlib.h in userspace Mikko Rapeli
                     ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Exit with error if using undefined variables or if any sub command fails
with error return value. unidef needs special handling since but this can
be done without the trap. Enables exaniming intermediate files if some
commands failed.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 scripts/headers_install.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index 5de5660..5391762 100644
--- a/scripts/headers_install.sh
+++ b/scripts/headers_install.sh
@@ -1,4 +1,7 @@
 #!/bin/sh
+set -e
+set -u
+#set -x
 
 if [ $# -lt 1 ]
 then
@@ -26,7 +29,6 @@ shift
 # Iterate through files listed on command line
 
 FILE=
-trap 'rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed"' EXIT
 for i in "$@"
 do
 	FILE="$(basename "$i")"
@@ -37,10 +39,13 @@ do
 		-e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
 		-e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
 		-e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
-		"$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
+		"$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || \
+		( rm -f "$OUTDIR/$FILE.sed" ; exit 1 )
 	scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
-		> "$OUTDIR/$FILE"
-	[ $? -gt 1 ] && exit 1
+		> "$OUTDIR/$FILE" || \
+		( if [ $? -gt 1 ]; then \
+				rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed" ; \
+				exit 1 ; \
+		  fi )
 	rm -f "$OUTDIR/$FILE.sed"
 done
-trap - EXIT
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 05/27] drm.h: include stdlib.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (3 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 04/27] headers_install.sh: enhance error handling Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 06/27] drm_mode.h: include stdint.h and linux/types.h " Mikko Rapeli
                     ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes <drm/drm.h> compilation error:

drm/drm.h:132:2: error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/drm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 9abbeb9..820fd01 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -42,6 +42,10 @@
 #include <asm/ioctl.h>
 typedef unsigned int drm_handle_t;
 
+#ifndef __KERNEL__
+#include <stdlib.h>
+#endif
+
 #else /* One of the BSDs */
 
 #include <sys/ioccom.h>
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 06/27] drm_mode.h: include stdint.h and linux/types.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (4 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 05/27] drm.h: include stdlib.h in userspace Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 07/27] exynos_drm.h: include stdint.h " Mikko Rapeli
                     ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

drm/drm_mode.h:472:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/drm_mode.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index f104c26..93b25bae 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -27,7 +27,12 @@
 #ifndef _DRM_MODE_H
 #define _DRM_MODE_H
 
+#ifdef __KERNEL__
 #include <linux/types.h>
+#else
+#include <stdint.h>
+#include <linux/types.h>
+#endif
 
 #define DRM_DISPLAY_INFO_LEN	32
 #define DRM_CONNECTOR_NAME_LEN	32
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 07/27] exynos_drm.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (5 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 06/27] drm_mode.h: include stdint.h and linux/types.h " Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:25   ` [RFC PATCH v2 08/27] nouveau_drm.h: " Mikko Rapeli
                     ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation errors like:

drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/exynos_drm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index d584412..59ee215 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -15,6 +15,11 @@
 #ifndef _UAPI_EXYNOS_DRM_H_
 #define _UAPI_EXYNOS_DRM_H_
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <drm/drm.h>
 
 /**
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 08/27] nouveau_drm.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (6 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 07/27] exynos_drm.h: include stdint.h " Mikko Rapeli
@ 2014-09-01  6:25   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 09/27] radeon_drm.h: " Mikko Rapeli
                     ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

drm/nouveau_drm.h:41:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/nouveau_drm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index 2a5769f..90b9b4a 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -25,6 +25,12 @@
 #ifndef __NOUVEAU_DRM_H__
 #define __NOUVEAU_DRM_H__
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 #define NOUVEAU_GEM_DOMAIN_CPU       (1 << 0)
 #define NOUVEAU_GEM_DOMAIN_VRAM      (1 << 1)
 #define NOUVEAU_GEM_DOMAIN_GART      (1 << 2)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 09/27] radeon_drm.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (7 preceding siblings ...)
  2014-09-01  6:25   ` [RFC PATCH v2 08/27] nouveau_drm.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 10/27] vmwgfx_drm.h: include drm/drm.h instead of drm.h " Mikko Rapeli
                     ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error:

drm/radeon_drm.h:794:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/radeon_drm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index aefa2f6..6b12bbb7 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -33,6 +33,11 @@
 #ifndef __RADEON_DRM_H__
 #define __RADEON_DRM_H__
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <drm/drm.h>
 
 /* WARNING: If you change any of these defines, make sure to change the
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 10/27] vmwgfx_drm.h: include drm/drm.h instead of drm.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (8 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 09/27] radeon_drm.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 11/27] dm-log-userspace.h: include stdint.h " Mikko Rapeli
                     ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

drm/vmwgfx_drm.h:31:17: fatal error: drm.h: No such file or directory

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/vmwgfx_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index 4fc66f6..c472bedb 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -29,7 +29,7 @@
 #define __VMWGFX_DRM_H__
 
 #ifndef __KERNEL__
-#include <drm.h>
+#include <drm/drm.h>
 #endif
 
 #define DRM_VMW_MAX_SURFACE_FACES 6
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 11/27] dm-log-userspace.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (9 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 10/27] vmwgfx_drm.h: include drm/drm.h instead of drm.h " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 12/27] hsi_char.h: " Mikko Rapeli
                     ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

linux/dm-log-userspace.h:416:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/dm-log-userspace.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/dm-log-userspace.h b/include/uapi/linux/dm-log-userspace.h
index 0fa0d9e..7b9684e 100644
--- a/include/uapi/linux/dm-log-userspace.h
+++ b/include/uapi/linux/dm-log-userspace.h
@@ -7,6 +7,11 @@
 #ifndef __DM_LOG_USERSPACE_H__
 #define __DM_LOG_USERSPACE_H__
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <linux/dm-ioctl.h> /* For DM_UUID_LEN */
 
 /*
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 12/27] hsi_char.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (10 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 11/27] dm-log-userspace.h: include stdint.h " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 13/27] ebtables.h: " Mikko Rapeli
                     ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error:

linux/hsi/hsi_char.h:51:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/hsi/hsi_char.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/hsi/hsi_char.h b/include/uapi/linux/hsi/hsi_char.h
index 76160b4..9fa8f91 100644
--- a/include/uapi/linux/hsi/hsi_char.h
+++ b/include/uapi/linux/hsi/hsi_char.h
@@ -20,10 +20,15 @@
  * 02110-1301 USA
  */
 
-
 #ifndef __HSI_CHAR_H
 #define __HSI_CHAR_H
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 #define HSI_CHAR_MAGIC		'k'
 #define HSC_IOW(num, dtype)	_IOW(HSI_CHAR_MAGIC, num, dtype)
 #define HSC_IOR(num, dtype)	_IOR(HSI_CHAR_MAGIC, num, dtype)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 13/27] ebtables.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (11 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 12/27] hsi_char.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 14/27] cld.h: " Mikko Rapeli
                     ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

linux/netfilter_bridge/ebtables.h:38:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/netfilter_bridge/ebtables.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/netfilter_bridge/ebtables.h b/include/uapi/linux/netfilter_bridge/ebtables.h
index ba99336..9e8d6b4 100644
--- a/include/uapi/linux/netfilter_bridge/ebtables.h
+++ b/include/uapi/linux/netfilter_bridge/ebtables.h
@@ -12,6 +12,11 @@
 
 #ifndef _UAPI__LINUX_BRIDGE_EFF_H
 #define _UAPI__LINUX_BRIDGE_EFF_H
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <linux/if.h>
 #include <linux/netfilter_bridge.h>
 #include <linux/if_ether.h>
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 14/27] cld.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (12 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 13/27] ebtables.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 15/27] rds.h: " Mikko Rapeli
                     ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

linux/nfsd/cld.h:40:2: error: unknown type name ‘uint16_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/nfsd/cld.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/nfsd/cld.h b/include/uapi/linux/nfsd/cld.h
index f14a9ab..9f60f9c 100644
--- a/include/uapi/linux/nfsd/cld.h
+++ b/include/uapi/linux/nfsd/cld.h
@@ -22,6 +22,12 @@
 #ifndef _NFSD_CLD_H
 #define _NFSD_CLD_H
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 /* latest upcall version available */
 #define CLD_UPCALL_VERSION 1
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 15/27] rds.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (13 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 14/27] cld.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 16/27] sctp.h: " Mikko Rapeli
                     ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

linux/rds.h:96:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/rds.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
index 9195095..7ff0c70 100644
--- a/include/uapi/linux/rds.h
+++ b/include/uapi/linux/rds.h
@@ -34,7 +34,11 @@
 #ifndef _LINUX_RDS_H
 #define _LINUX_RDS_H
 
+#ifdef __KERNEL__
 #include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 
 #define RDS_IB_ABI_VERSION		0x301
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 16/27] sctp.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (14 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 15/27] rds.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 17/27] scsi_bsg_fc.h: " Mikko Rapeli
                     ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

linux/sctp.h:652:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/sctp.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index 266022a..f68d79a 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -53,7 +53,11 @@
 #ifndef _UAPI_SCTP_H
 #define _UAPI_SCTP_H
 
+#ifdef __KERNEL__
 #include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <linux/socket.h>
 
 typedef __s32 sctp_assoc_t;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 17/27] scsi_bsg_fc.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (15 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 16/27] sctp.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 18/27] scsi_netlink.h: " Mikko Rapeli
                     ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

scsi/scsi_bsg_fc.h:83:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/scsi/scsi_bsg_fc.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
index 3031b90..5cc25df 100644
--- a/include/uapi/scsi/scsi_bsg_fc.h
+++ b/include/uapi/scsi/scsi_bsg_fc.h
@@ -22,6 +22,12 @@
 #ifndef SCSI_BSG_FC_H
 #define SCSI_BSG_FC_H
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 /*
  * This file intended to be included by both kernel and user space
  */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 18/27] scsi_netlink.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (16 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 17/27] scsi_bsg_fc.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 19/27] scsi_netlink_fc.h: " Mikko Rapeli
                     ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

scsi/scsi_netlink.h:43:2: error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/scsi/scsi_netlink.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/uapi/scsi/scsi_netlink.h b/include/uapi/scsi/scsi_netlink.h
index 62b4eda..9d14592 100644
--- a/include/uapi/scsi/scsi_netlink.h
+++ b/include/uapi/scsi/scsi_netlink.h
@@ -22,8 +22,12 @@
 #ifndef SCSI_NETLINK_H
 #define SCSI_NETLINK_H
 
-#include <linux/netlink.h>
+#ifdef __KERNEL__
 #include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+#include <linux/netlink.h>
 
 /*
  * This file intended to be included by both kernel and user space
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 19/27] scsi_netlink_fc.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (17 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 18/27] scsi_netlink.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 20/27] hdspm.h: " Mikko Rapeli
                     ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-list before ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/scsi/scsi_netlink_fc.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h
index cbf76e4..d969337 100644
--- a/include/uapi/scsi/scsi_netlink_fc.h
+++ b/include/uapi/scsi/scsi_netlink_fc.h
@@ -21,6 +21,11 @@
 #ifndef SCSI_NETLINK_FC_H
 #define SCSI_NETLINK_FC_H
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
 #include <scsi/scsi_netlink.h>
 
 /*
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 20/27] hdspm.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (18 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 19/27] scsi_netlink_fc.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 21/27] gntalloc.h: " Mikko Rapeli
                     ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

sound/hdspm.h:43:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/sound/hdspm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h
index d956c35..f799828 100644
--- a/include/uapi/sound/hdspm.h
+++ b/include/uapi/sound/hdspm.h
@@ -20,6 +20,12 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
 #define HDSPM_MAX_CHANNELS      64
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 21/27] gntalloc.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (19 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 20/27] hdspm.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 22/27] gntdev.h: " Mikko Rapeli
                     ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

xen/gntalloc.h:22:2: error: unknown type name ‘uint16_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/xen/gntalloc.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/xen/gntalloc.h b/include/uapi/xen/gntalloc.h
index 76bd580..184df7e 100644
--- a/include/uapi/xen/gntalloc.h
+++ b/include/uapi/xen/gntalloc.h
@@ -11,6 +11,12 @@
 #ifndef __LINUX_PUBLIC_GNTALLOC_H__
 #define __LINUX_PUBLIC_GNTALLOC_H__
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 /*
  * Allocates a new page and creates a new grant reference.
  */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 22/27] gntdev.h: include stdint.h in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (20 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 21/27] gntalloc.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 23/27] r128_drm.h: include drm/drm.h Mikko Rapeli
                     ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compilation error:

xen/gntdev.h:38:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/xen/gntdev.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/xen/gntdev.h b/include/uapi/xen/gntdev.h
index 5304bd3..f724f75 100644
--- a/include/uapi/xen/gntdev.h
+++ b/include/uapi/xen/gntdev.h
@@ -33,6 +33,12 @@
 #ifndef __LINUX_PUBLIC_GNTDEV_H__
 #define __LINUX_PUBLIC_GNTDEV_H__
 
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
 struct ioctl_gntdev_grant_ref {
 	/* The domain ID of the grant to be mapped. */
 	uint32_t domid;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 23/27] r128_drm.h: include drm/drm.h
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (21 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 22/27] gntdev.h: " Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 24/27] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
                     ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compile error:

drm/r128_drm.h:156:23: error: array type has incomplete element type
  struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/r128_drm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/r128_drm.h b/include/uapi/drm/r128_drm.h
index 8d8878b..76b0aa3 100644
--- a/include/uapi/drm/r128_drm.h
+++ b/include/uapi/drm/r128_drm.h
@@ -33,6 +33,8 @@
 #ifndef __R128_DRM_H__
 #define __R128_DRM_H__
 
+#include <drm/drm.h>
+
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the X server file (r128_sarea.h)
  */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 24/27] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (22 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 23/27] r128_drm.h: include drm/drm.h Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 25/27] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
                     ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error:

drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/via_drm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 8b0533c..791531e 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -24,6 +24,7 @@
 #ifndef _VIA_DRM_H_
 #define _VIA_DRM_H_
 
+#include <linux/types.h>
 #include <drm/drm.h>
 
 /* WARNING: These defines must be the same as what the Xserver uses.
@@ -33,9 +34,6 @@
 #ifndef _VIA_DEFINES_
 #define _VIA_DEFINES_
 
-#ifndef __KERNEL__
-#include "via_drmclient.h"
-#endif
 
 #define VIA_NR_SAREA_CLIPRECTS		8
 #define VIA_NR_XVMC_PORTS               10
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 25/27] via_drm.h: hide struct via_file_private in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (23 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 24/27] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 26/27] savage_drm.h: include <drm/drm.h> Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 27/27] sis_drm.h: hide sis_file_private in userspace Mikko Rapeli
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error since list_head is not exported to userspace headers.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/via_drm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 791531e..34ce658 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -272,8 +272,10 @@ typedef struct drm_via_dmablit {
 	drm_via_blitsync_t sync;
 } drm_via_dmablit_t;
 
+#ifdef __KERNEL__
 struct via_file_private {
 	struct list_head obj_list;
 };
+#endif
 
 #endif				/* _VIA_DRM_H_ */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 26/27] savage_drm.h: include <drm/drm.h>
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (24 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 25/27] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  2014-09-01  6:26   ` [RFC PATCH v2 27/27] sis_drm.h: hide sis_file_private in userspace Mikko Rapeli
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error:

drm/savage_drm.h:50:24: error: array type has incomplete element type
  struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/savage_drm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/savage_drm.h b/include/uapi/drm/savage_drm.h
index 818d49b..9dc9dc1 100644
--- a/include/uapi/drm/savage_drm.h
+++ b/include/uapi/drm/savage_drm.h
@@ -26,6 +26,8 @@
 #ifndef __SAVAGE_DRM_H__
 #define __SAVAGE_DRM_H__
 
+#include <drm/drm.h>
+
 #ifndef __SAVAGE_SAREA_DEFINES__
 #define __SAVAGE_SAREA_DEFINES__
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC PATCH v2 27/27] sis_drm.h: hide sis_file_private in userspace
  2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
                     ` (25 preceding siblings ...)
  2014-09-01  6:26   ` [RFC PATCH v2 26/27] savage_drm.h: include <drm/drm.h> Mikko Rapeli
@ 2014-09-01  6:26   ` Mikko Rapeli
  26 siblings, 0 replies; 28+ messages in thread
From: Mikko Rapeli @ 2014-09-01  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, mikko.rapeli

Fixes compiler error:

drm/sis_drm.h:68:19: error: field ‘obj_list’ has incomplete type
  struct list_head obj_list;

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/sis_drm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/drm/sis_drm.h b/include/uapi/drm/sis_drm.h
index df37632..3d0903f 100644
--- a/include/uapi/drm/sis_drm.h
+++ b/include/uapi/drm/sis_drm.h
@@ -64,8 +64,10 @@ typedef struct {
 	unsigned long offset, size;
 } drm_sis_fb_t;
 
+#ifdef __KERNEL__
 struct sis_file_private {
 	struct list_head obj_list;
 };
+#endif
 
 #endif				/* __SIS_DRM_H__ */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-09-01  6:26 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1408660449-4011-1-git-send-email-mikko.rapeli@iki.fi>
2014-09-01  6:25 ` [RFC PATCH v2 00/27] Compile test and fixes for exported header files Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 01/27] Compile test script " Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 02/27] scripts/headers.sh: add verbose option to make calls if defined Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 03/27] Makefile: propagate verbose options Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 04/27] headers_install.sh: enhance error handling Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 05/27] drm.h: include stdlib.h in userspace Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 06/27] drm_mode.h: include stdint.h and linux/types.h " Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 07/27] exynos_drm.h: include stdint.h " Mikko Rapeli
2014-09-01  6:25   ` [RFC PATCH v2 08/27] nouveau_drm.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 09/27] radeon_drm.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 10/27] vmwgfx_drm.h: include drm/drm.h instead of drm.h " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 11/27] dm-log-userspace.h: include stdint.h " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 12/27] hsi_char.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 13/27] ebtables.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 14/27] cld.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 15/27] rds.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 16/27] sctp.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 17/27] scsi_bsg_fc.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 18/27] scsi_netlink.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 19/27] scsi_netlink_fc.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 20/27] hdspm.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 21/27] gntalloc.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 22/27] gntdev.h: " Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 23/27] r128_drm.h: include drm/drm.h Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 24/27] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 25/27] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 26/27] savage_drm.h: include <drm/drm.h> Mikko Rapeli
2014-09-01  6:26   ` [RFC PATCH v2 27/27] sis_drm.h: hide sis_file_private in userspace Mikko Rapeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).