[U-Boot] [PATCH 0/7] Crazy patches (Nightmare of <stdint.h>)

Commit 0d296cc2d3b (Provide option to avoid defining a custome version of uintptr_t) and commit 4166ecb247 (Add some standard headers external code might need) made a horrible decision.
I raised a flag in the following threads: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/203954 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/198550/focus=205880
It looks like Simon is not understanding me. Nor does anybody else have any interest in this topic.
This series is here to show what will happen next and how horrible it is.
Masahiro Yamada (7): types.h: define (u)int8_t, (u)int16_t, (u)int32_t based on compiler info (MAD) types.h: define s8, s16, s32, s64, u8, u16, u32, u64 based on compiler info (MAD) types: defined __s8, __16, __s32, __s64, __u8, __u16, __u32, __u64 based on compiler info (MAD) Check if compiler-provided <stdint.h> and <inttypes.h> are available if CONFIG_USE_STDINT=y (MAD) Replace "llx" with PRIx64 to fix warnings on sandbox (MAD) Use PRIx32 etc. to print out 32bit-width variable (MAD) Make BITS_PER_LONG compiler-dependent (MAD)
Makefile | 2 +- arch/arc/include/asm/types.h | 34 +++++ arch/arm/include/asm/types.h | 37 +++++ arch/avr32/include/asm/types.h | 36 +++++ arch/blackfin/include/asm/types.h | 36 +++++ arch/m68k/include/asm/types.h | 37 +++++ arch/microblaze/include/asm/types.h | 36 +++++ arch/mips/include/asm/types.h | 36 +++++ arch/nds32/include/asm/types.h | 36 ++++- arch/nios2/include/asm/types.h | 35 +++++ arch/openrisc/include/asm/types.h | 35 +++++ arch/powerpc/include/asm/types.h | 36 +++++ arch/sandbox/include/asm/types.h | 34 +++++ arch/sh/include/asm/types.h | 35 +++++ arch/sparc/include/asm/types.h | 35 +++++ arch/x86/include/asm/types.h | 35 +++++ common/fdt_support.c | 2 +- config.mk | 12 ++ disk/part_efi.c | 12 +- fs/fat/fat.c | 35 ++--- include/inttypes.h | 287 ------------------------------------ include/linux/types.h | 15 ++ include/u-boot/zlib.h | 2 +- scripts/gcc-have-stdint.sh | 21 +++ 24 files changed, 607 insertions(+), 314 deletions(-) delete mode 100644 include/inttypes.h create mode 100755 scripts/gcc-have-stdint.sh

The intent of this series is to show the nasty problems introduced by <stdint.h>.
Simon and I are already discussing this in the following thread: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/203954 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/198550/focus=205880
-----
Commit 0d296cc2d3b8 (Provide option to avoid defining a custom version of uintptr_t.) introduced CONFIG_USE_STDINT. If it is enabled, <stdint.h> is included and uint64_t, u_int64_t, int64_t are defined based on the compiler-provided information. While, inconsistently, that commit left uint_{8,16,32}_t, u_int{8,16,32}t, int_{8,16,32}t to be hard-coded in include/linux/types.h.
This causes type conflicts between the typedefs defined in the compiler's <stdint.h> and the ones hard-coded in include/linux/types.h.
As you may know, 'uint32_t' is defined as 'unsigned long' in some compilers such as bare metal ARM toolchain, whereas it is defined as 'unsigned int' in kernel.org ones. (This is also clearly mentioned in Linux's arch/arm/include/asm/types.h)
If you make a decision to use a compiler-provided <stdint.h>, we cannot hard-code the fixed-width types. To avoid the type conflicts, we must make all of them compiler-dependent consistently.
You can reproduce this problem, for example, with a Linaro toolchain.
Visit "http://www.linaro.org/downloads/" and download "Bare-metal toolchain for Cortex-R/M and Cortex-A".
$ make USE_STDINT=1 CROSS_COMPILE=arm-none-eabi- omap4_panda_defconfig all HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o [snip] CC lib/asm-offsets.s In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:40:24: error: conflicting types for 'int32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:99:17: note: previous declaration of 'int32_t' was here In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:52:25: error: conflicting types for 'uint32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:105:17: note: previous declaration of 'uint32_t' was here
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
include/linux/types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/linux/types.h b/include/linux/types.h index c9a8d9a..5549479 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -91,18 +91,33 @@ typedef unsigned long ulong; #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__
+#if defined(CONFIG_USE_STDINT) +typedef __UINT8_TYPE__ u_int8_t; +typedef __INT8_TYPE__ int8_t; +typedef __UINT16_TYPE__ u_int16_t; +typedef __INT16_TYPE__ int16_t; +typedef __UINT32_TYPE__ u_int32_t; +typedef __INT32_TYPE__ int32_t; +#else typedef __u8 u_int8_t; typedef __s8 int8_t; typedef __u16 u_int16_t; typedef __s16 int16_t; typedef __u32 u_int32_t; typedef __s32 int32_t; +#endif
#endif /* !(__BIT_TYPES_DEFINED__) */
+#if defined(CONFIG_USE_STDINT) +typedef __UINT8_TYPE__ uint8_t; +typedef __UINT16_TYPE__ uint16_t; +typedef __UINT32_TYPE__ uint32_t; +#else typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; +#endif
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \ (!defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__))

Hi Masahiro,
On 22 December 2014 at 03:15, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
The intent of this series is to show the nasty problems introduced by <stdint.h>.
Simon and I are already discussing this in the following thread: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/203954 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/198550/focus=205880
I'll reply on that thread but I will add a few comments on each patch as well.
Commit 0d296cc2d3b8 (Provide option to avoid defining a custom version of uintptr_t.) introduced CONFIG_USE_STDINT. If it is enabled, <stdint.h> is included and uint64_t, u_int64_t, int64_t are defined based on the compiler-provided information. While, inconsistently, that commit left uint_{8,16,32}_t, u_int{8,16,32}t, int_{8,16,32}t to be hard-coded in include/linux/types.h.
This causes type conflicts between the typedefs defined in the compiler's <stdint.h> and the ones hard-coded in include/linux/types.h.
As you may know, 'uint32_t' is defined as 'unsigned long' in some compilers such as bare metal ARM toolchain, whereas it is defined as 'unsigned int' in kernel.org ones. (This is also clearly mentioned in Linux's arch/arm/include/asm/types.h)
In that file, it actually redefines the types so that stdint.h can be included. Are you suggesting that we should follow the same route?
That suggests that Gabe's implementation is not correct, but not that the whole concept is wrong.
* As the typedefs for these types in 'stdint.h' are based on builtin defines * supplied by GCC, we can tweak these to align with the kernel's idea of those * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same * source file (provided that -ffreestanding is used).
If you make a decision to use a compiler-provided <stdint.h>, we cannot hard-code the fixed-width types. To avoid the type conflicts, we must make all of them compiler-dependent consistently.
You can reproduce this problem, for example, with a Linaro toolchain.
Visit "http://www.linaro.org/downloads/" and download "Bare-metal toolchain for Cortex-R/M and Cortex-A".
$ make USE_STDINT=1 CROSS_COMPILE=arm-none-eabi- omap4_panda_defconfig all HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o [snip] CC lib/asm-offsets.s In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:40:24: error: conflicting types for 'int32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:99:17: note: previous declaration of 'int32_t' was here In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:52:25: error: conflicting types for 'uint32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:105:17: note: previous declaration of 'uint32_t' was here
I suspect I have not tested this toolchain, so have not see this problem. Perhaps this compiler cannot support stdint.h?
In any case I don't think it is necessary to fiddle with the 8, 16, 32-bit types, so this patch is not needed.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com
include/linux/types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/linux/types.h b/include/linux/types.h index c9a8d9a..5549479 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -91,18 +91,33 @@ typedef unsigned long ulong; #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__
+#if defined(CONFIG_USE_STDINT) +typedef __UINT8_TYPE__ u_int8_t; +typedef __INT8_TYPE__ int8_t; +typedef __UINT16_TYPE__ u_int16_t; +typedef __INT16_TYPE__ int16_t; +typedef __UINT32_TYPE__ u_int32_t; +typedef __INT32_TYPE__ int32_t; +#else typedef __u8 u_int8_t; typedef __s8 int8_t; typedef __u16 u_int16_t; typedef __s16 int16_t; typedef __u32 u_int32_t; typedef __s32 int32_t; +#endif
#endif /* !(__BIT_TYPES_DEFINED__) */
+#if defined(CONFIG_USE_STDINT) +typedef __UINT8_TYPE__ uint8_t; +typedef __UINT16_TYPE__ uint16_t; +typedef __UINT32_TYPE__ uint32_t; +#else typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; +#endif
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \ (!defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)) -- 1.9.1
Regards, Simon

Hi Simon,
On Mon, 22 Dec 2014 21:41:48 -0700 Simon Glass sjg@chromium.org wrote:
Hi Masahiro,
On 22 December 2014 at 03:15, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
The intent of this series is to show the nasty problems introduced by <stdint.h>.
Simon and I are already discussing this in the following thread: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/203954 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/198550/focus=205880
I'll reply on that thread but I will add a few comments on each patch as well.
Commit 0d296cc2d3b8 (Provide option to avoid defining a custom version of uintptr_t.) introduced CONFIG_USE_STDINT. If it is enabled, <stdint.h> is included and uint64_t, u_int64_t, int64_t are defined based on the compiler-provided information. While, inconsistently, that commit left uint_{8,16,32}_t, u_int{8,16,32}t, int_{8,16,32}t to be hard-coded in include/linux/types.h.
This causes type conflicts between the typedefs defined in the compiler's <stdint.h> and the ones hard-coded in include/linux/types.h.
As you may know, 'uint32_t' is defined as 'unsigned long' in some compilers such as bare metal ARM toolchain, whereas it is defined as 'unsigned int' in kernel.org ones. (This is also clearly mentioned in Linux's arch/arm/include/asm/types.h)
In that file, it actually redefines the types so that stdint.h can be included. Are you suggesting that we should follow the same route?
No. What I wanted you to notice was the type conflicts. This matrix:
* int32_t uint32_t uintptr_t * bare metal GCC long unsigned long unsigned int * glibc GCC int unsigned int unsigned int * kernel int unsigned int unsigned long
Undefing __UINT32_TYPE__ etc. is an ugly workaround.
The best way is to avoid including <stdint.h>.
That suggests that Gabe's implementation is not correct, but not that the whole concept is wrong.
- As the typedefs for these types in 'stdint.h' are based on builtin defines
- supplied by GCC, we can tweak these to align with the kernel's idea of those
- types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
- source file (provided that -ffreestanding is used).
Accoding to Documentation/arm/kernel_mode_neon.txt, the kernel deos not want to include <stdint.h>.
It wants to <arm_neon.h> but unfortunately <arm_neon.h> is including <stdint.h>.
That is the difference: it looks like you like to include <stdint.h>.
If you make a decision to use a compiler-provided <stdint.h>, we cannot hard-code the fixed-width types. To avoid the type conflicts, we must make all of them compiler-dependent consistently.
You can reproduce this problem, for example, with a Linaro toolchain.
Visit "http://www.linaro.org/downloads/" and download "Bare-metal toolchain for Cortex-R/M and Cortex-A".
$ make USE_STDINT=1 CROSS_COMPILE=arm-none-eabi- omap4_panda_defconfig all HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o [snip] CC lib/asm-offsets.s In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:40:24: error: conflicting types for 'int32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:99:17: note: previous declaration of 'int32_t' was here In file included from /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint.h:5:0, from include/compiler.h:117, from include/image.h:19, from include/common.h:82, from lib/asm-offsets.c:15: /opt/gcc-arm-none-eabi-4_7-2013q1/bin/../lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h:52:25: error: conflicting types for 'uint32_t' In file included from include/common.h:21:0, from lib/asm-offsets.c:15: include/linux/types.h:105:17: note: previous declaration of 'uint32_t' was here
I suspect I have not tested this toolchain, so have not see this problem. Perhaps this compiler cannot support stdint.h?
It does support stdint.h. It is not the compiler's fault, but your and Gabe's fault.
In any case I don't think it is necessary to fiddle with the 8, 16, 32-bit types, so this patch is not needed.
As I wrote in another reply, please answer:
Why do you want to change the 64bit-types only?
Best Regards Masahiro Yamada

If CONFIG_USE_STDINT is defined, (u)int_{8,16,32,64}_t are provided by <stdint.h>. s{8,16,32,64}, u{8,16,32,64} must be consistent with them.
For example, some compilers define "uint32_t" as "unsigned long" and some define it as "unsigned int". "u32" should have the compatible type with "uint32_t". We cannot hard-code its definition when CONFIG_USE_STDINT is enabled. If we want to use <stdint.h>, it must be consistent everywhere.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
arch/arc/include/asm/types.h | 14 ++++++++++++++ arch/arm/include/asm/types.h | 16 ++++++++++++++++ arch/avr32/include/asm/types.h | 16 ++++++++++++++++ arch/blackfin/include/asm/types.h | 16 ++++++++++++++++ arch/m68k/include/asm/types.h | 16 ++++++++++++++++ arch/microblaze/include/asm/types.h | 16 ++++++++++++++++ arch/mips/include/asm/types.h | 16 ++++++++++++++++ arch/nds32/include/asm/types.h | 16 ++++++++++++++++ arch/nios2/include/asm/types.h | 16 ++++++++++++++++ arch/openrisc/include/asm/types.h | 16 ++++++++++++++++ arch/powerpc/include/asm/types.h | 16 ++++++++++++++++ arch/sandbox/include/asm/types.h | 14 ++++++++++++++ arch/sh/include/asm/types.h | 16 ++++++++++++++++ arch/sparc/include/asm/types.h | 14 ++++++++++++++ arch/x86/include/asm/types.h | 14 ++++++++++++++ 15 files changed, 232 insertions(+)
diff --git a/arch/arc/include/asm/types.h b/arch/arc/include/asm/types.h index 24eeb76..daa1f30 100644 --- a/arch/arc/include/asm/types.h +++ b/arch/arc/include/asm/types.h @@ -31,6 +31,19 @@ typedef unsigned long long __u64; /* * These aren't exported outside the kernel to avoid name space clashes */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else typedef signed char s8; typedef unsigned char u8;
@@ -42,6 +55,7 @@ typedef unsigned int u32;
typedef signed long long s64; typedef unsigned long long u64; +#endif
#define BITS_PER_LONG 32
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 2326420..4ab7e6b 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -27,6 +27,20 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -39,6 +53,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #ifdef CONFIG_ARM64 #define BITS_PER_LONG 64 #else /* CONFIG_ARM64 */ diff --git a/arch/avr32/include/asm/types.h b/arch/avr32/include/asm/types.h index 65de677..fe355a2 100644 --- a/arch/avr32/include/asm/types.h +++ b/arch/avr32/include/asm/types.h @@ -39,6 +39,20 @@ __extension__ typedef unsigned long long __u64;
#ifndef __ASSEMBLY__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef __signed__ char s8; typedef unsigned char u8;
@@ -51,6 +65,8 @@ typedef unsigned int u32; typedef __signed__ long long s64; typedef unsigned long long u64;
+#endif + /* Dma addresses are 32-bits wide. */
typedef u32 dma_addr_t; diff --git a/arch/blackfin/include/asm/types.h b/arch/blackfin/include/asm/types.h index 92124f1..5ed8462 100644 --- a/arch/blackfin/include/asm/types.h +++ b/arch/blackfin/include/asm/types.h @@ -44,6 +44,20 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -56,6 +70,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
/* Dma addresses are 32-bits wide. */ diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h index 3ffcab2..51bf08d 100644 --- a/arch/m68k/include/asm/types.h +++ b/arch/m68k/include/asm/types.h @@ -27,6 +27,20 @@ typedef struct { /* * These aren't exported outside the kernel to avoid name space clashes */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -39,6 +53,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
/* DMA addresses are 32-bits wide */ diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h index 77094f6..343bf84 100644 --- a/arch/microblaze/include/asm/types.h +++ b/arch/microblaze/include/asm/types.h @@ -35,6 +35,20 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -47,6 +61,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
/* Dma addresses are 32-bits wide. */ diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h index aebafdb..9fc4a6d 100644 --- a/arch/mips/include/asm/types.h +++ b/arch/mips/include/asm/types.h @@ -46,6 +46,20 @@ typedef unsigned long long __u64;
#ifndef __ASSEMBLY__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef __signed char s8; typedef unsigned char u8;
@@ -58,6 +72,8 @@ typedef unsigned int u32; typedef __signed__ long long s64; typedef unsigned long long u64;
+#endif + #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ || defined(CONFIG_64BIT) typedef u64 dma_addr_t; diff --git a/arch/nds32/include/asm/types.h b/arch/nds32/include/asm/types.h index 2e8924f..e2c56d7 100644 --- a/arch/nds32/include/asm/types.h +++ b/arch/nds32/include/asm/types.h @@ -37,6 +37,20 @@ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -49,6 +63,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
#include <stddef.h> diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index ea859c0..b3b25b3 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -35,6 +35,20 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -47,6 +61,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
/* Dma addresses are 32-bits wide. */ diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 1fe00bf..8a232bc 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -41,6 +41,20 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -53,6 +67,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
/* Dma addresses are 32-bits wide. */ diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index b29ce79..cc76387 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -27,6 +27,20 @@ typedef struct { /* * These aren't exported outside the kernel to avoid name space clashes */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; +#else + typedef signed char s8; typedef unsigned char u8;
@@ -39,6 +53,8 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#endif + #define BITS_PER_LONG 32
#ifdef CONFIG_PHYS_64BIT diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 42c09e2..a6a51b7 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -33,6 +33,18 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +#else + typedef signed char s8; typedef unsigned char u8;
@@ -42,6 +54,8 @@ typedef unsigned short u16; typedef signed int s32; typedef unsigned int u32;
+#endif + #if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__) typedef signed long long s64; typedef unsigned long long u64; diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h index aed4a6e..7b005e4 100644 --- a/arch/sh/include/asm/types.h +++ b/arch/sh/include/asm/types.h @@ -35,6 +35,20 @@ __extension__ typedef unsigned long long __u64;
#ifndef __ASSEMBLY__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; + +#else
typedef __signed__ char s8; typedef unsigned char u8; @@ -48,6 +62,8 @@ typedef unsigned int u32; typedef __signed__ long long s64; typedef unsigned long long u64;
+#endif + /* Dma addresses are 32-bits wide. */
typedef u32 dma_addr_t; diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h index 72030b2..41c653a 100644 --- a/arch/sparc/include/asm/types.h +++ b/arch/sparc/include/asm/types.h @@ -34,6 +34,20 @@ typedef struct { /* * These aren't exported outside the kernel to avoid name space clashes */ + +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +typedef __INT64_TYPE__ s64; +typedef __UINT64_TYPE__ u64; + typedef signed char s8; typedef unsigned char u8;
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index e272c90..ca773de 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -27,6 +27,18 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ s8; +typedef __UINT8_TYPE__ u8; + +typedef __INT16_TYPE__ s16; +typedef __UINT16_TYPE__ u16; + +typedef __INT32_TYPE__ s32; +typedef __UINT32_TYPE__ u32; + +#else + typedef signed char s8; typedef unsigned char u8;
@@ -36,6 +48,8 @@ typedef unsigned short u16; typedef signed int s32; typedef unsigned int u32;
+#endif + #if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__) typedef signed long long s64; typedef unsigned long long u64;

For the same reason as the last commit, keep the typedefs of __s{8,16,32,64} and __u{8,16,32,64} compatible with other types.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
arch/arc/include/asm/types.h | 16 ++++++++++++++++ arch/arm/include/asm/types.h | 17 +++++++++++++++++ arch/avr32/include/asm/types.h | 16 ++++++++++++++++ arch/blackfin/include/asm/types.h | 16 ++++++++++++++++ arch/m68k/include/asm/types.h | 17 +++++++++++++++++ arch/microblaze/include/asm/types.h | 16 ++++++++++++++++ arch/mips/include/asm/types.h | 16 ++++++++++++++++ arch/nds32/include/asm/types.h | 16 +++++++++++++++- arch/nios2/include/asm/types.h | 15 +++++++++++++++ arch/openrisc/include/asm/types.h | 15 +++++++++++++++ arch/powerpc/include/asm/types.h | 16 ++++++++++++++++ arch/sandbox/include/asm/types.h | 16 ++++++++++++++++ arch/sh/include/asm/types.h | 15 +++++++++++++++ arch/sparc/include/asm/types.h | 17 +++++++++++++++++ arch/x86/include/asm/types.h | 17 +++++++++++++++++ 15 files changed, 240 insertions(+), 1 deletion(-)
diff --git a/arch/arc/include/asm/types.h b/arch/arc/include/asm/types.h index daa1f30..5693e5f 100644 --- a/arch/arc/include/asm/types.h +++ b/arch/arc/include/asm/types.h @@ -14,6 +14,21 @@ typedef unsigned short umode_t; * header files exported to user space */
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -27,6 +42,7 @@ typedef unsigned int __u32; typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif
/* * These aren't exported outside the kernel to avoid name space clashes diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 4ab7e6b..e24acc59 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -8,6 +8,21 @@ typedef unsigned short umode_t; * header files exported to user space */
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -22,6 +37,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + /* * These aren't exported outside the kernel to avoid name space clashes */ diff --git a/arch/avr32/include/asm/types.h b/arch/avr32/include/asm/types.h index fe355a2..032a765 100644 --- a/arch/avr32/include/asm/types.h +++ b/arch/avr32/include/asm/types.h @@ -10,6 +10,21 @@
typedef unsigned short umode_t;
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + /* * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space @@ -27,6 +42,7 @@ typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif +#endif
#endif /* __ASSEMBLY__ */
diff --git a/arch/blackfin/include/asm/types.h b/arch/blackfin/include/asm/types.h index 5ed8462..8cae642 100644 --- a/arch/blackfin/include/asm/types.h +++ b/arch/blackfin/include/asm/types.h @@ -23,6 +23,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -39,6 +53,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + /* * These aren't exported outside the kernel to avoid name space clashes */ diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h index 51bf08d..83de4d5 100644 --- a/arch/m68k/include/asm/types.h +++ b/arch/m68k/include/asm/types.h @@ -5,6 +5,21 @@
typedef unsigned short umode_t;
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -19,6 +34,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + typedef struct { __u32 u[4]; } __attribute__((aligned(16))) vector128; diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h index 343bf84..afcd811 100644 --- a/arch/microblaze/include/asm/types.h +++ b/arch/microblaze/include/asm/types.h @@ -15,6 +15,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -30,6 +44,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + /* * These aren't exported outside the kernel to avoid name space clashes */ diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h index 9fc4a6d..f372c70 100644 --- a/arch/mips/include/asm/types.h +++ b/arch/mips/include/asm/types.h @@ -17,6 +17,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -35,6 +49,8 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif
+#endif + #endif /* __ASSEMBLY__ */
/* diff --git a/arch/nds32/include/asm/types.h b/arch/nds32/include/asm/types.h index e2c56d7..8416cef 100644 --- a/arch/nds32/include/asm/types.h +++ b/arch/nds32/include/asm/types.h @@ -17,6 +17,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -31,7 +45,7 @@ typedef unsigned int __u32; typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif - +#endif /* * These aren't exported outside the kernel to avoid name space clashes */ diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index b3b25b3..43c76cc 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -15,6 +15,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -29,6 +43,7 @@ typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif +#endif
/* * These aren't exported outside the kernel to avoid name space clashes diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 8a232bc..069c8d6 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -21,6 +21,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -35,6 +49,7 @@ typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif +#endif
/* * These aren't exported outside the kernel to avoid name space clashes diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index cc76387..71868ef 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -5,6 +5,21 @@
typedef unsigned short umode_t;
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -18,6 +33,7 @@ typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif +#endif
typedef struct { __u32 u[4]; diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index a6a51b7..1bb168c 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -13,6 +13,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -28,6 +42,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + /* * These aren't exported outside the kernel to avoid name space clashes */ diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h index 7b005e4..eb47b0f 100644 --- a/arch/sh/include/asm/types.h +++ b/arch/sh/include/asm/types.h @@ -9,6 +9,20 @@ typedef unsigned short umode_t; * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space */ +#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else
typedef __signed__ char __s8; typedef unsigned char __u8; @@ -23,6 +37,7 @@ typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif +#endif
#endif /* __ASSEMBLY__ */
diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h index 41c653a..79484c5 100644 --- a/arch/sparc/include/asm/types.h +++ b/arch/sparc/include/asm/types.h @@ -12,6 +12,21 @@
typedef unsigned short umode_t;
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -26,6 +41,8 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif
+#endif + typedef struct { __u32 u[4]; } __attribute__((aligned(16))) vector128; diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index ca773de..88c6645 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -8,6 +8,21 @@ typedef unsigned short umode_t; * header files exported to user space */
+#if defined(CONFIG_USE_STDINT) +typedef __INT8_TYPE__ __s8; +typedef __UINT8_TYPE__ __u8; + +typedef __INT16_TYPE__ __s16; +typedef __UINT16_TYPE__ __u16; + +typedef __INT32_TYPE__ __s32; +typedef __UINT32_TYPE__ __u32; + +typedef __INT64_TYPE__ __s64; +typedef __UINT64_TYPE__ __u64; + +#else + typedef __signed__ char __s8; typedef unsigned char __u8;
@@ -22,6 +37,8 @@ __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; #endif
+#endif + /* * These aren't exported outside the kernel to avoid name space clashes */

CONFIG_USE_STDINT was introduced to use compiler-provided types for fixed-width variables. This must be consistent everywhere to avoid warnings/errors including printf() and friends.
Assume the code below
uint32_t foo;
printf("foo= %x\n", foo);
If <stdint.h> is included, uint32_t is defined by the compiler. The code above only works on compilers that define "uint32_t" as "unsigned int". Actually there exist compilers that define "uint32_t" as "unsigned long".
Going forward, to print out fixed-width variables, we always have to use PRIxN like this
uint32_t foo;
printf("foo= " PRIx32 "\n", foo);
Notice,
- Typedefs ( uint32_t, int32_t etc.) are provided by <stdint.h> - Printf formats ( PRIx32, PRId32 etc.) are provided by <inttypes.h>
Also notice, it makes sense only when <stdint.h> and <inttypes.h> are provided by the same compiler. ^^^^^^^^^^^^^^^^^^
Commit 4166ecb24 (Add some standard headers external code might need) added hard-coded include/inttypes.h. It provides hard-coded PRIx32 "x", but it does not make sense. Some compiler's <stdint.h> define "uint32_t" as "unsigned long" and expect the format string "lx" to print out "uint32_t" variable.
This commit: - Adds scripts/gcc-have-stdint.sh to check if the compiler is providing both <stdint.h> and <inttypes.h>
- Modifies config.mk to error-out if CONFIG_USE_STDINT is enabled, but <stdint.h> or <inttyps.h> is missing
- Modifies the top Makefile to delete "-nostdinc" option and allow to include compiler-provided <inttypes.h>
- Remove hard-coded include/inttypes.h
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
Makefile | 2 +- config.mk | 12 ++ include/inttypes.h | 287 --------------------------------------------- scripts/gcc-have-stdint.sh | 21 ++++ 4 files changed, 34 insertions(+), 288 deletions(-) delete mode 100644 include/inttypes.h create mode 100755 scripts/gcc-have-stdint.sh
diff --git a/Makefile b/Makefile index 1560bff..b44e504 100644 --- a/Makefile +++ b/Makefile @@ -591,7 +591,7 @@ UBOOTINCLUDE := \ -I$(srctree)/arch/$(ARCH)/include \ -include $(srctree)/include/linux/kconfig.h
-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS += -isystem $(shell $(CC) -print-file-name=include) CHECKFLAGS += $(NOSTDINC_FLAGS)
# FIX ME diff --git a/config.mk b/config.mk index 64c2951..91f60d4 100644 --- a/config.mk +++ b/config.mk @@ -64,6 +64,18 @@ ifneq ($(USE_STDINT),) PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT endif
+ifeq ($(CONFIG_USE_STDINT),y) +HAVE_STDINT := $(shell $(CONFIG_SHELL) scripts/gcc-have-stdint.sh $(CC)) + +ifeq ($(HAVE_STDINT),) +$(warning you have enabled CONFIG_USE_STDINT (or given USE_STDINT=1 from the command line)) +$(warning but your compiler is not providing <stdint.h> or <inttypes.h>.) +$(error check your compiler.) + +endif + +endif + #########################################################################
RELFLAGS := $(PLATFORM_RELFLAGS) diff --git a/include/inttypes.h b/include/inttypes.h deleted file mode 100644 index e2e569d..0000000 --- a/include/inttypes.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc. - * - * This file is taken from the GNU C Library v2.15, with the unimplemented - * functions removed and a few style fixes. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -/* - * ISO C99: 7.8 Format conversion of integer types <inttypes.h> - */ - -#ifndef _INTTYPES_H -#define _INTTYPES_H 1 - -#include <linux/compiler.h> - -/* Get a definition for wchar_t. But we must not define wchar_t itself. */ -#ifndef ____gwchar_t_defined -# ifdef __cplusplus -# define __gwchar_t wchar_t -# elif defined __WCHAR_TYPE__ -typedef __WCHAR_TYPE__ __gwchar_t; -# else -# define __need_wchar_t -# include <stddef.h> -typedef wchar_t __gwchar_t; -# endif -# define ____gwchar_t_defined 1 -#endif - - -/* The ISO C99 standard specifies that these macros must only be - defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_FORMAT_MACROS - -#ifdef CONFIG_USE_STDINT -# if __WORDSIZE == 64 -# define __PRI64_PREFIX "l" -# define __PRIPTR_PREFIX "l" -# else -# define __PRI64_PREFIX "ll" -# define __PRIPTR_PREFIX -# endif -#else -/* linux/types.h always uses long long for 64-bit and long for uintptr_t */ -# define __PRI64_PREFIX "ll" -# define __PRIPTR_PREFIX "l" -#endif - -/* Macros for printing format specifiers. */ - -/* Decimal notation. */ -# define PRId8 "d" -# define PRId16 "d" -# define PRId32 "d" -# define PRId64 __PRI64_PREFIX "d" - -# define PRIdLEAST8 "d" -# define PRIdLEAST16 "d" -# define PRIdLEAST32 "d" -# define PRIdLEAST64 __PRI64_PREFIX "d" - -# define PRIdFAST8 "d" -# define PRIdFAST16 __PRIPTR_PREFIX "d" -# define PRIdFAST32 __PRIPTR_PREFIX "d" -# define PRIdFAST64 __PRI64_PREFIX "d" - - -# define PRIi8 "i" -# define PRIi16 "i" -# define PRIi32 "i" -# define PRIi64 __PRI64_PREFIX "i" - -# define PRIiLEAST8 "i" -# define PRIiLEAST16 "i" -# define PRIiLEAST32 "i" -# define PRIiLEAST64 __PRI64_PREFIX "i" - -# define PRIiFAST8 "i" -# define PRIiFAST16 __PRIPTR_PREFIX "i" -# define PRIiFAST32 __PRIPTR_PREFIX "i" -# define PRIiFAST64 __PRI64_PREFIX "i" - -/* Octal notation. */ -# define PRIo8 "o" -# define PRIo16 "o" -# define PRIo32 "o" -# define PRIo64 __PRI64_PREFIX "o" - -# define PRIoLEAST8 "o" -# define PRIoLEAST16 "o" -# define PRIoLEAST32 "o" -# define PRIoLEAST64 __PRI64_PREFIX "o" - -# define PRIoFAST8 "o" -# define PRIoFAST16 __PRIPTR_PREFIX "o" -# define PRIoFAST32 __PRIPTR_PREFIX "o" -# define PRIoFAST64 __PRI64_PREFIX "o" - -/* Unsigned integers. */ -# define PRIu8 "u" -# define PRIu16 "u" -# define PRIu32 "u" -# define PRIu64 __PRI64_PREFIX "u" - -# define PRIuLEAST8 "u" -# define PRIuLEAST16 "u" -# define PRIuLEAST32 "u" -# define PRIuLEAST64 __PRI64_PREFIX "u" - -# define PRIuFAST8 "u" -# define PRIuFAST16 __PRIPTR_PREFIX "u" -# define PRIuFAST32 __PRIPTR_PREFIX "u" -# define PRIuFAST64 __PRI64_PREFIX "u" - -/* lowercase hexadecimal notation. */ -# define PRIx8 "x" -# define PRIx16 "x" -# define PRIx32 "x" -# define PRIx64 __PRI64_PREFIX "x" - -# define PRIxLEAST8 "x" -# define PRIxLEAST16 "x" -# define PRIxLEAST32 "x" -# define PRIxLEAST64 __PRI64_PREFIX "x" - -# define PRIxFAST8 "x" -# define PRIxFAST16 __PRIPTR_PREFIX "x" -# define PRIxFAST32 __PRIPTR_PREFIX "x" -# define PRIxFAST64 __PRI64_PREFIX "x" - -/* UPPERCASE hexadecimal notation. */ -# define PRIX8 "X" -# define PRIX16 "X" -# define PRIX32 "X" -# define PRIX64 __PRI64_PREFIX "X" - -# define PRIXLEAST8 "X" -# define PRIXLEAST16 "X" -# define PRIXLEAST32 "X" -# define PRIXLEAST64 __PRI64_PREFIX "X" - -# define PRIXFAST8 "X" -# define PRIXFAST16 __PRIPTR_PREFIX "X" -# define PRIXFAST32 __PRIPTR_PREFIX "X" -# define PRIXFAST64 __PRI64_PREFIX "X" - - -/* Macros for printing `intmax_t' and `uintmax_t'. */ -# define PRIdMAX __PRI64_PREFIX "d" -# define PRIiMAX __PRI64_PREFIX "i" -# define PRIoMAX __PRI64_PREFIX "o" -# define PRIuMAX __PRI64_PREFIX "u" -# define PRIxMAX __PRI64_PREFIX "x" -# define PRIXMAX __PRI64_PREFIX "X" - - -/* Macros for printing `intptr_t' and `uintptr_t'. */ -# define PRIdPTR __PRIPTR_PREFIX "d" -# define PRIiPTR __PRIPTR_PREFIX "i" -# define PRIoPTR __PRIPTR_PREFIX "o" -# define PRIuPTR __PRIPTR_PREFIX "u" -# define PRIxPTR __PRIPTR_PREFIX "x" -# define PRIXPTR __PRIPTR_PREFIX "X" - - -/* Macros for scanning format specifiers. */ - -/* Signed decimal notation. */ -# define SCNd8 "hhd" -# define SCNd16 "hd" -# define SCNd32 "d" -# define SCNd64 __PRI64_PREFIX "d" - -# define SCNdLEAST8 "hhd" -# define SCNdLEAST16 "hd" -# define SCNdLEAST32 "d" -# define SCNdLEAST64 __PRI64_PREFIX "d" - -# define SCNdFAST8 "hhd" -# define SCNdFAST16 __PRIPTR_PREFIX "d" -# define SCNdFAST32 __PRIPTR_PREFIX "d" -# define SCNdFAST64 __PRI64_PREFIX "d" - -/* Signed decimal notation. */ -# define SCNi8 "hhi" -# define SCNi16 "hi" -# define SCNi32 "i" -# define SCNi64 __PRI64_PREFIX "i" - -# define SCNiLEAST8 "hhi" -# define SCNiLEAST16 "hi" -# define SCNiLEAST32 "i" -# define SCNiLEAST64 __PRI64_PREFIX "i" - -# define SCNiFAST8 "hhi" -# define SCNiFAST16 __PRIPTR_PREFIX "i" -# define SCNiFAST32 __PRIPTR_PREFIX "i" -# define SCNiFAST64 __PRI64_PREFIX "i" - -/* Unsigned decimal notation. */ -# define SCNu8 "hhu" -# define SCNu16 "hu" -# define SCNu32 "u" -# define SCNu64 __PRI64_PREFIX "u" - -# define SCNuLEAST8 "hhu" -# define SCNuLEAST16 "hu" -# define SCNuLEAST32 "u" -# define SCNuLEAST64 __PRI64_PREFIX "u" - -# define SCNuFAST8 "hhu" -# define SCNuFAST16 __PRIPTR_PREFIX "u" -# define SCNuFAST32 __PRIPTR_PREFIX "u" -# define SCNuFAST64 __PRI64_PREFIX "u" - -/* Octal notation. */ -# define SCNo8 "hho" -# define SCNo16 "ho" -# define SCNo32 "o" -# define SCNo64 __PRI64_PREFIX "o" - -# define SCNoLEAST8 "hho" -# define SCNoLEAST16 "ho" -# define SCNoLEAST32 "o" -# define SCNoLEAST64 __PRI64_PREFIX "o" - -# define SCNoFAST8 "hho" -# define SCNoFAST16 __PRIPTR_PREFIX "o" -# define SCNoFAST32 __PRIPTR_PREFIX "o" -# define SCNoFAST64 __PRI64_PREFIX "o" - -/* Hexadecimal notation. */ -# define SCNx8 "hhx" -# define SCNx16 "hx" -# define SCNx32 "x" -# define SCNx64 __PRI64_PREFIX "x" - -# define SCNxLEAST8 "hhx" -# define SCNxLEAST16 "hx" -# define SCNxLEAST32 "x" -# define SCNxLEAST64 __PRI64_PREFIX "x" - -# define SCNxFAST8 "hhx" -# define SCNxFAST16 __PRIPTR_PREFIX "x" -# define SCNxFAST32 __PRIPTR_PREFIX "x" -# define SCNxFAST64 __PRI64_PREFIX "x" - - -/* Macros for scanning `intmax_t' and `uintmax_t'. */ -# define SCNdMAX __PRI64_PREFIX "d" -# define SCNiMAX __PRI64_PREFIX "i" -# define SCNoMAX __PRI64_PREFIX "o" -# define SCNuMAX __PRI64_PREFIX "u" -# define SCNxMAX __PRI64_PREFIX "x" - -/* Macros for scaning `intptr_t' and `uintptr_t'. */ -# define SCNdPTR __PRIPTR_PREFIX "d" -# define SCNiPTR __PRIPTR_PREFIX "i" -# define SCNoPTR __PRIPTR_PREFIX "o" -# define SCNuPTR __PRIPTR_PREFIX "u" -# define SCNxPTR __PRIPTR_PREFIX "x" - -#endif /* C++ && format macros */ - - -#if __WORDSIZE == 64 - -/* We have to define the `uintmax_t' type using `ldiv_t'. */ -typedef struct { - long int quot; /* Quotient. */ - long int rem; /* Remainder. */ -} imaxdiv_t; - -#else - -/* We have to define the `uintmax_t' type using `lldiv_t'. */ -typedef struct { - long long int quot; /* Quotient. */ - long long int rem; /* Remainder. */ -} imaxdiv_t; - -#endif - -#endif /* inttypes.h */ diff --git a/scripts/gcc-have-stdint.sh b/scripts/gcc-have-stdint.sh new file mode 100755 index 0000000..555ede6 --- /dev/null +++ b/scripts/gcc-have-stdint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Test if the compiler has <stdint.h> and <inttypes.> +# Kernel.org toolchains do not provide them. +# +# CONFIG_USE_STDINT makes sense only when +# both <stdint.h> and <inttypes.h> are provided by the compiler. +# +TMP="$$" + +cat <<END | $@ -Werror -x c - -c -o $TMP >/dev/null 2>&1 && echo "y" +#include <stdint.h> +#include <inttypes.h> + +int main(void) +{ + return 0; +} +END + +rm -f $TMP

Hi Masahiro,
On 22 December 2014 at 03:16, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
CONFIG_USE_STDINT was introduced to use compiler-provided types for fixed-width variables. This must be consistent everywhere to avoid warnings/errors including printf() and friends.
Assume the code below
uint32_t foo;
printf("foo= %x\n", foo);
If <stdint.h> is included, uint32_t is defined by the compiler. The code above only works on compilers that define "uint32_t" as "unsigned int". Actually there exist compilers that define "uint32_t" as "unsigned long".
Going forward, to print out fixed-width variables, we always have to use PRIxN like this
uint32_t foo;
printf("foo= " PRIx32 "\n", foo);
Notice,
- Typedefs ( uint32_t, int32_t etc.) are provided by <stdint.h>
- Printf formats ( PRIx32, PRId32 etc.) are provided by <inttypes.h>
Also notice, it makes sense only when <stdint.h> and <inttypes.h> are provided by the same compiler. ^^^^^^^^^^^^^^^^^^
Commit 4166ecb24 (Add some standard headers external code might need) added hard-coded include/inttypes.h. It provides hard-coded PRIx32 "x", but it does not make sense. Some compiler's <stdint.h> define "uint32_t" as "unsigned long" and expect the format string "lx" to print out "uint32_t" variable.
This commit:
Adds scripts/gcc-have-stdint.sh to check if the compiler is providing both <stdint.h> and <inttypes.h>
Modifies config.mk to error-out if CONFIG_USE_STDINT is enabled, but <stdint.h> or <inttyps.h> is missing
Modifies the top Makefile to delete "-nostdinc" option and allow to include compiler-provided <inttypes.h>
Remove hard-coded include/inttypes.h
This patch looks good to me except that I don't understand why you are removing inttypes.h? Where will the PRI defines come from? Or is it because you are fixing things such that the defines are not needed anymore?
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com
Makefile | 2 +- config.mk | 12 ++ include/inttypes.h | 287 --------------------------------------------- scripts/gcc-have-stdint.sh | 21 ++++ 4 files changed, 34 insertions(+), 288 deletions(-) delete mode 100644 include/inttypes.h create mode 100755 scripts/gcc-have-stdint.sh
[snip]
Regards, Simon

Hi Simon,
On Mon, 22 Dec 2014 21:46:26 -0700 Simon Glass sjg@chromium.org wrote:
Hi Masahiro,
On 22 December 2014 at 03:16, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
CONFIG_USE_STDINT was introduced to use compiler-provided types for fixed-width variables. This must be consistent everywhere to avoid warnings/errors including printf() and friends.
Assume the code below
uint32_t foo;
printf("foo= %x\n", foo);
If <stdint.h> is included, uint32_t is defined by the compiler. The code above only works on compilers that define "uint32_t" as "unsigned int". Actually there exist compilers that define "uint32_t" as "unsigned long".
Going forward, to print out fixed-width variables, we always have to use PRIxN like this
uint32_t foo;
printf("foo= " PRIx32 "\n", foo);
Notice,
- Typedefs ( uint32_t, int32_t etc.) are provided by <stdint.h>
- Printf formats ( PRIx32, PRId32 etc.) are provided by <inttypes.h>
Also notice, it makes sense only when <stdint.h> and <inttypes.h> are provided by the same compiler. ^^^^^^^^^^^^^^^^^^
Commit 4166ecb24 (Add some standard headers external code might need) added hard-coded include/inttypes.h. It provides hard-coded PRIx32 "x", but it does not make sense. Some compiler's <stdint.h> define "uint32_t" as "unsigned long" and expect the format string "lx" to print out "uint32_t" variable.
This commit:
Adds scripts/gcc-have-stdint.sh to check if the compiler is providing both <stdint.h> and <inttypes.h>
Modifies config.mk to error-out if CONFIG_USE_STDINT is enabled, but <stdint.h> or <inttyps.h> is missing
Modifies the top Makefile to delete "-nostdinc" option and allow to include compiler-provided <inttypes.h>
Remove hard-coded include/inttypes.h
This patch looks good to me except that I don't understand why you are removing inttypes.h? Where will the PRI defines come from? Or is it because you are fixing things such that the defines are not needed anymore?
According to this question, I am afraid you are not understanding <inttypes.h> very well. Maybe is this page useful? http://pubs.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html
My commit description has also answered your question:
Notice, - Typedefs ( uint32_t, int32_t etc.) are provided by <stdint.h> - Printf formats ( PRIx32, PRId32 etc.) are provided by <inttypes.h> Also notice, it makes sense only when <stdint.h> and <inttypes.h> are provided by the same compiler.
Best Regards Masahiro Yamada

These must be fixed to fix sandbox at least. (Horrible things are happening on the other boards, of course.)
If we include <stdint.h>, we do not know 64bit-types are defined as "unsigned long long" or "unsigned long". (As for my 64bit GCC, __UINT64_TYPE__ is "long unsigned int")
We cannot hard-code "%llx" in printf() or friends anymore. We must always use PRIx64 etc.
(As Documentation/printk-formats.txt clearly says, Linux Kernel always uses "%llx" to print 64bit variables, and U-Boot used to do that. But we lost the convenience by commit 0d296cc and commit 4166ecb24)
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
common/fdt_support.c | 2 +- disk/part_efi.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c index 8266bca..6211a82 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -1533,7 +1533,7 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width, if (ret < 0) return ret;
- snprintf(name, sizeof(name), "framebuffer@%llx", base_address); + snprintf(name, sizeof(name), "framebuffer@%" PRIx64, base_address); ret = fdt_set_name(fdt, node, name); if (ret < 0) return ret; diff --git a/disk/part_efi.c b/disk/part_efi.c index efed58f..3fe280d 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -113,7 +113,7 @@ void print_part_efi(block_dev_desc_t * dev_desc) if (!is_pte_valid(&gpt_pte[i])) break;
- printf("%3d\t0x%08llx\t0x%08llx\t"%s"\n", (i + 1), + printf("%3d\t0x%08" PRIx64 "\t0x%08" PRIx64 "\t"%s"\n", (i + 1), le64_to_cpu(gpt_pte[i].starting_lba), le64_to_cpu(gpt_pte[i].ending_lba), print_efiname(&gpt_pte[i])); @@ -530,7 +530,7 @@ static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba, /* Check the GPT header signature */ if (le64_to_cpu(pgpt_head->signature) != GPT_HEADER_SIGNATURE) { printf("GUID Partition Table Header signature is wrong:" - "0x%llX != 0x%llX\n", + "0x%" PRIX64 " != 0x%llX\n", le64_to_cpu(pgpt_head->signature), GPT_HEADER_SIGNATURE); return 0; @@ -554,7 +554,7 @@ static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
/* Check that the my_lba entry points to the LBA that contains the GPT */ if (le64_to_cpu(pgpt_head->my_lba) != lba) { - printf("GPT: my_lba incorrect: %llX != %" PRIX64 "\n", + printf("GPT: my_lba incorrect: %" PRIX64 " != %" PRIX64 "\n", le64_to_cpu(pgpt_head->my_lba), lba); return 0; @@ -563,17 +563,17 @@ static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba, /* Check the first_usable_lba and last_usable_lba are within the disk. */ lastlba = (u64)dev_desc->lba; if (le64_to_cpu(pgpt_head->first_usable_lba) > lastlba) { - printf("GPT: first_usable_lba incorrect: %llX > %" PRIX64 "\n", + printf("GPT: first_usable_lba incorrect: %" PRIX64 " > %" PRIX64 "\n", le64_to_cpu(pgpt_head->first_usable_lba), lastlba); return 0; } if (le64_to_cpu(pgpt_head->last_usable_lba) > lastlba) { - printf("GPT: last_usable_lba incorrect: %llX > %" PRIX64 "\n", + printf("GPT: last_usable_lba incorrect: %" PRIx64 " > %" PRIX64 "\n", le64_to_cpu(pgpt_head->last_usable_lba), lastlba); return 0; }
- debug("GPT: first_usable_lba: %llX last_usable_lba %llX last lba %" + debug("GPT: first_usable_lba: %" PRIx64 "last_usable_lba %" PRIX64 " last lba %" PRIX64 "\n", le64_to_cpu(pgpt_head->first_usable_lba), le64_to_cpu(pgpt_head->last_usable_lba), lastlba);

Dear Masahiro Yamada,
In message 1419243363-11542-6-git-send-email-yamada.m@jp.panasonic.com you wrote:
These must be fixed to fix sandbox at least. (Horrible things are happening on the other boards, of course.)
If we include <stdint.h>, we do not know 64bit-types are defined as "unsigned long long" or "unsigned long". (As for my 64bit GCC, __UINT64_TYPE__ is "long unsigned int")
We cannot hard-code "%llx" in printf() or friends anymore. We must always use PRIx64 etc.
(As Documentation/printk-formats.txt clearly says, Linux Kernel always uses "%llx" to print 64bit variables, and U-Boot used to do that. But we lost the convenience by commit 0d296cc and commit 4166ecb24)
I think we should reconsider these two commits, then.
The use of the PRIx?? macros is really ugly and makes the code very hard to read. This alone should be reason to avoid that - in addition we deviate from the Linux kernel, so adapting code from there becomes much more difficult.
I think we should especially strive to maintain compatibility with Linux code.
Best regards,
Wolfgang Denk

Hi Masahiro,
On 22 December 2014 at 03:16, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
These must be fixed to fix sandbox at least. (Horrible things are happening on the other boards, of course.)
If we include <stdint.h>, we do not know 64bit-types are defined as "unsigned long long" or "unsigned long". (As for my 64bit GCC, __UINT64_TYPE__ is "long unsigned int")
We cannot hard-code "%llx" in printf() or friends anymore. We must always use PRIx64 etc.
(As Documentation/printk-formats.txt clearly says, Linux Kernel always uses "%llx" to print 64bit variables, and U-Boot used to do that. But we lost the convenience by commit 0d296cc and commit 4166ecb24)
I think we should study how the kernel does this - basically by redefining __UIN32_TYPE__, etc. as far as I understand it. From what you are saying, I gather that the PRI defines will then not be needed.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com
Regards, Simon

If <stdint.h> is included, the definition of fixed-width types are compiler-dependent.
For example, some compilers use "unsigned long" and some compilers use "unsigned int" for 32bit width typedefs.
That means, we can no longer use hard-code "%x" or "%d" to print 32bit-width variables.
We use printf() everywhere to print 32bit variables.
This commit only fixes fs/fat/fat.c because I cannot imagine how many days I have to spend to eliminate all the warnings. (Of course, I do not think we should do such ridiculous things.)
Just in case, I put the warnings I got for Panda board below:
$ make USE_STDINT=1 CROSS_COMPILE=arm-none-eabi- omap4_panda_defconfig all # # configuration written to .config # # # configuration written to spl/.config # scripts/kconfig/conf --silentoldconfig Kconfig scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config.h GEN include/autoconf.mk GEN include/autoconf.mk.dep GEN spl/include/autoconf.mk CHK include/config/uboot.release UPD include/config/uboot.release CHK include/generated/version_autogenerated.h UPD include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CC lib/asm-offsets.s GEN include/generated/generic-asm-offsets.h CC arch/arm/lib/asm-offsets.s GEN include/generated/asm-offsets.h LD arch/arm/cpu/built-in.o CC arch/arm/cpu/armv7/cache_v7.o arch/arm/cpu/armv7/cache_v7.c: In function 'v7_dcache_inval_range': arch/arm/cpu/armv7/cache_v7.c:174:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/cache_v7.c:185:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] CC arch/arm/cpu/armv7/cpu.o CC arch/arm/cpu/armv7/syslib.o AS arch/arm/cpu/armv7/lowlevel_init.o CC arch/arm/cpu/armv7/omap-common/reset.o CC arch/arm/cpu/armv7/omap-common/timer.o arch/arm/cpu/armv7/omap-common/timer.c: In function 'timer_init': arch/arm/cpu/armv7/omap-common/timer.c:39:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:41:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:45:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c: In function '__udelay': arch/arm/cpu/armv7/omap-common/timer.c:64:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:67:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c: In function 'get_timer_masked': arch/arm/cpu/armv7/omap-common/timer.c:79:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap-common/utils.o CC arch/arm/cpu/armv7/omap-common/hwinit-common.o In file included from arch/arm/cpu/armv7/omap-common/hwinit-common.c:18:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'omap_rev_string': arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'wait_for_command_complete': arch/arm/cpu/armv7/omap-common/hwinit-common.c:159:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'watchdog_init': arch/arm/cpu/armv7/omap-common/hwinit-common.c:171:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c:173:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap-common/clocks-common.o In file included from arch/arm/cpu/armv7/omap-common/clocks-common.c:24:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'setup_post_dividers': arch/arm/cpu/armv7/omap-common/clocks-common.c:80:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:82:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:84:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:86:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:88:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:90:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:92:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:94:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:96:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:98:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_bypass_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:105:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:105:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_lock_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:125:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:125:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'check_for_lock': arch/arm/cpu/armv7/omap-common/clocks-common.c:144:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_setup_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:220:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:252:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'configure_mpu_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:332:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:332:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap-common/emif-common.o In file included from arch/arm/cpu/armv7/omap-common/emif-common.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'set_lpmode_selfrefresh': arch/arm/cpu/armv7/omap-common/emif-common.c:27:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:31:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:34:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'get_mr': arch/arm/cpu/armv7/omap-common/emif-common.c:59:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:61:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:63:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'set_mr': arch/arm/cpu/armv7/omap-common/emif-common.c:79:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:80:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_reset_phy': arch/arm/cpu/armv7/omap-common/emif-common.c:88:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:90:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'lpddr2_init': arch/arm/cpu/armv7/omap-common/emif-common.c:129:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:129:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:135:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:135:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:141:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:142:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:150:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:151:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:154:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:154:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_update_timings': arch/arm/cpu/armv7/omap-common/emif-common.c:166:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:167:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:168:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:169:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:172:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:174:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:175:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:177:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:178:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:180:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:183:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:186:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:189:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'omap5_ddr3_leveling': arch/arm/cpu/armv7/omap-common/emif-common.c:199:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:211:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:214:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:218:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:222:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:225:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:235:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:241:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'ddr3_init': arch/arm/cpu/armv7/omap-common/emif-common.c:261:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:264:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:265:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:266:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:268:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:269:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:277:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:278:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:280:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:281:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:286:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'do_sdram_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1010:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1082:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_post_init_config': arch/arm/cpu/armv7/omap-common/emif-common.c:1096:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'dmm_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1186:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1187:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1188:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1189:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1191:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1193:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1195:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1197:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1204:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1206:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1208:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1210:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'do_bug0039_workaround': arch/arm/cpu/armv7/omap-common/emif-common.c:1270:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'sdram_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1303:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1345:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1345:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] CC arch/arm/cpu/armv7/omap-common/vc.o CC arch/arm/cpu/armv7/omap-common/abb.o CC arch/arm/cpu/armv7/omap-common/omap-cache.o CC arch/arm/cpu/armv7/omap-common/boot-common.o AS arch/arm/cpu/armv7/omap-common/lowlevel_init.o CC arch/arm/cpu/armv7/omap-common/mem-common.o arch/arm/cpu/armv7/omap-common/mem-common.c: In function 'enable_gpmc_cs_config': arch/arm/cpu/armv7/omap-common/mem-common.c:56:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:59:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:60:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:61:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:62:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:63:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:64:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:66:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c: In function 'gpmc_init': arch/arm/cpu/armv7/omap-common/mem-common.c:126:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:127:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:128:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:130:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:134:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:139:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD arch/arm/cpu/armv7/omap-common/built-in.o CC arch/arm/cpu/armv7/omap4/sdram_elpida.o In file included from arch/arm/cpu/armv7/omap4/sdram_elpida.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap4/hwinit.o In file included from arch/arm/cpu/armv7/omap4/hwinit.c:19:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap4/emif.o In file included from arch/arm/cpu/armv7/omap4/emif.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/cpu/armv7/omap4/prcm-regs.o CC arch/arm/cpu/armv7/omap4/hw_data.o LD arch/arm/cpu/armv7/omap4/built-in.o LD arch/arm/cpu/armv7/built-in.o AS arch/arm/cpu/armv7/start.o AS arch/arm/lib/vectors.o AS arch/arm/lib/crt0.o AS arch/arm/lib/relocate.o CC arch/arm/lib/bootm-fdt.o CC arch/arm/lib/bootm.o CC arch/arm/lib/cache-pl310.o arch/arm/lib/cache-pl310.c: In function 'pl310_cache_sync': arch/arm/lib/cache-pl310.c:19:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/lib/cache-pl310.c: In function 'pl310_background_op_all_ways': arch/arm/lib/cache-pl310.c:26:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/lib/cache-pl310.c: In function 'v7_outer_cache_flush_range': arch/arm/lib/cache-pl310.c:65:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/lib/cache-pl310.c: In function 'v7_outer_cache_inval_range': arch/arm/lib/cache-pl310.c:82:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/lib/cache-pl310.c:93:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/lib/cache-pl310.c:99:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC arch/arm/lib/sections.o CC arch/arm/lib/interrupts.o CC arch/arm/lib/reset.o CC arch/arm/lib/cache.o CC arch/arm/lib/cache-cp15.o LD arch/arm/lib/built-in.o AR arch/arm/lib/lib.a CC arch/arm/lib/eabi_compat.o CC board/ti/panda/panda.o board/ti/panda/panda.c: In function 'misc_init_r': board/ti/panda/panda.c:211:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:221:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:226:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:236:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:239:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:248:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD board/ti/panda/built-in.o CC common/main.o CC common/exports.o CC common/hash.o CC common/cli_hush.o CC common/autoboot.o CC common/board_f.o CC common/board_r.o CC common/cmd_boot.o CC common/cmd_bootm.o CC common/bootm.o CC common/bootm_os.o CC common/cmd_help.o CC common/cmd_version.o CC common/env_attr.o CC common/env_callback.o CC common/env_flags.o CC common/env_nowhere.o CC common/cmd_source.o CC common/cmd_bdinfo.o CC common/cmd_console.o CC common/cmd_echo.o CC common/cmd_exit.o CC common/cmd_ext4.o CC common/cmd_ext2.o CC common/cmd_fat.o CC common/cmd_fdt.o common/cmd_fdt.c: In function 'fdt_value_setenv': common/cmd_fdt.c:60:3: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c: In function 'do_fdt': common/cmd_fdt.c:138:11: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:193:11: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:473:32: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:475:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:475:10: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:477:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:479:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:481:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:482:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] common/cmd_fdt.c:484:10: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:487:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:490:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:493:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:539:6: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:539:6: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:539:6: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:539:6: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c: In function 'fdt_valid': common/cmd_fdt.c:685:6: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c:691:6: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c: In function 'print_data': common/cmd_fdt.c:883:6: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] common/cmd_fdt.c: In function 'fdt_print': common/cmd_fdt.c:1015:5: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] CC common/fdt_support.o common/fdt_support.c: In function 'of_bus_default_map': common/fdt_support.c:975:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'u64' [-Wformat] common/fdt_support.c:975:2: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'u64' [-Wformat] common/fdt_support.c:975:2: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'u64' [-Wformat] common/fdt_support.c: In function 'of_translate_one': common/fdt_support.c:1054:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'u64' [-Wformat] common/fdt_support.c: In function 'fdt_verify_alias_address': common/fdt_support.c:1385:10: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u64' [-Wformat] common/fdt_support.c:1385:10: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u64' [-Wformat] common/fdt_support.c: In function 'fdt_setup_simplefb_node': common/fdt_support.c:1536:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u64' [-Wformat] CC common/cmd_fs.o CC common/cmd_gpio.o CC common/cmd_i2c.o CC common/cmd_itest.o CC common/cmd_load.o CC common/cmd_mem.o common/cmd_mem.c: In function 'mod_mem': common/cmd_mem.c:1148:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] CC common/cmd_misc.o CC common/cmd_mmc.o common/cmd_mmc.c: In function 'do_mmc_read': common/cmd_mmc.c:303:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] common/cmd_mmc.c:303:9: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u32' [-Wformat] common/cmd_mmc.c:308:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] common/cmd_mmc.c: In function 'do_mmc_write': common/cmd_mmc.c:331:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] common/cmd_mmc.c:331:9: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u32' [-Wformat] common/cmd_mmc.c:338:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] common/cmd_mmc.c: In function 'do_mmc_erase': common/cmd_mmc.c:359:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] common/cmd_mmc.c:359:9: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u32' [-Wformat] common/cmd_mmc.c:366:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] CC common/cmd_net.o CC common/cmd_pcmcia.o CC common/cmd_spi.o CC common/cmd_test.o CC common/cmd_usb.o CC common/usb.o CC common/usb_hub.o CC common/usb_storage.o CC common/cmd_ximg.o CC common/cmd_spl.o CC common/flash.o CC common/splash.o CC common/cmd_nvedit.o CC common/env_common.o CC common/console.o CC common/dlmalloc.o CC common/image.o common/image.c: In function 'image_print_contents': common/image.c:308:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/image.c:309:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/image.c: In function 'genimg_print_size': common/image.c:505:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] CC common/image-fdt.o CC common/memsize.o CC common/stdio.o CC common/cli_simple.o CC common/cli.o CC common/cli_readline.o CC common/command.o CC common/s_record.o CC common/xyzModem.o CC common/cmd_disk.o LD common/built-in.o CC disk/part.o CC disk/part_dos.o LD disk/built-in.o LD drivers/block/built-in.o LD drivers/crypto/fsl/built-in.o LD drivers/crypto/built-in.o LD drivers/dfu/built-in.o LD drivers/hwmon/built-in.o CC drivers/input/input.o LD drivers/input/built-in.o LD drivers/memory/built-in.o LD drivers/misc/built-in.o CC drivers/pcmcia/tqm8xx_pcmcia.o LD drivers/pcmcia/built-in.o LD drivers/pwm/built-in.o CC drivers/rtc/date.o LD drivers/rtc/built-in.o LD drivers/soc/built-in.o LD drivers/sound/built-in.o LD drivers/thermal/built-in.o LD drivers/tpm/built-in.o LD drivers/twserial/built-in.o LD drivers/video/built-in.o LD drivers/watchdog/built-in.o LD drivers/built-in.o LD drivers/dma/built-in.o CC drivers/gpio/omap_gpio.o LD drivers/gpio/built-in.o CC drivers/i2c/i2c_core.o CC drivers/i2c/omap24xx_i2c.o LD drivers/i2c/built-in.o CC drivers/mmc/mmc.o CC drivers/mmc/omap_hsmmc.o drivers/mmc/omap_hsmmc.c: In function 'mmc_reset_controller_fsm': drivers/mmc/omap_hsmmc.c:308:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_send_cmd': drivers/mmc/omap_hsmmc.c:335:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] CC drivers/mmc/mmc_write.o LD drivers/mmc/built-in.o LD drivers/mtd/built-in.o LD drivers/mtd/onenand/built-in.o LD drivers/mtd/spi/built-in.o LD drivers/net/built-in.o LD drivers/net/phy/built-in.o LD drivers/pci/built-in.o CC drivers/power/twl6030.o LD drivers/power/built-in.o LD drivers/power/battery/built-in.o LD drivers/power/fuel_gauge/built-in.o LD drivers/power/mfd/built-in.o LD drivers/power/pmic/built-in.o CC drivers/serial/serial.o CC drivers/serial/serial_ns16550.o CC drivers/serial/ns16550.o CC drivers/serial/usbtty.o LD drivers/serial/built-in.o CC drivers/spi/spi.o CC drivers/spi/omap3_spi.o drivers/spi/omap3_spi.c: In function 'omap3_spi_write': drivers/spi/omap3_spi.c:248:12: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/spi/omap3_spi.c: In function 'omap3_spi_read': drivers/spi/omap3_spi.c:303:12: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/spi/omap3_spi.c: In function 'omap3_spi_txrx': drivers/spi/omap3_spi.c:357:12: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/spi/omap3_spi.c:375:12: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] LD drivers/spi/built-in.o CC drivers/usb/eth/usb_ether.o CC drivers/usb/eth/smsc95xx.o drivers/usb/eth/smsc95xx.c: In function 'smsc95xx_write_reg': drivers/usb/eth/smsc95xx.c:165:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:165:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c: In function 'smsc95xx_read_reg': drivers/usb/eth/smsc95xx.c:183:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c: In function 'smsc95xx_set_csums': drivers/usb/eth/smsc95xx.c:418:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c: In function 'smsc95xx_init': drivers/usb/eth/smsc95xx.c:522:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:532:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:556:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:566:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:572:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:589:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:599:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c: In function 'smsc95xx_recv': drivers/usb/eth/smsc95xx.c:752:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] drivers/usb/eth/smsc95xx.c:758:4: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] LD drivers/usb/eth/built-in.o CC drivers/usb/gadget/core.o CC drivers/usb/gadget/ep0.o LD drivers/usb/gadget/built-in.o CC drivers/usb/host/ehci-hcd.o drivers/usb/host/ehci-hcd.c: In function 'ehci_submit_async': drivers/usb/host/ehci-hcd.c:591:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:607:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:637:3: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] drivers/usb/host/ehci-hcd.c:637:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] drivers/usb/host/ehci-hcd.c:637:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'u32' [-Wformat] drivers/usb/host/ehci-hcd.c: In function 'usb_lowlevel_init': drivers/usb/host/ehci-hcd.c:1028:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:1059:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:1059:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c: In function 'poll_int_queue': drivers/usb/host/ehci-hcd.c:1323:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:1336:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c: In function 'destroy_int_queue': drivers/usb/host/ehci-hcd.c:1358:3: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c: In function 'submit_int_msg': drivers/usb/host/ehci-hcd.c:1414:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] drivers/usb/host/ehci-hcd.c:1414:3: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] CC drivers/usb/host/ehci-omap.o drivers/usb/host/ehci-omap.c: In function 'omap_uhh_reset': drivers/usb/host/ehci-omap.c:34:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:37:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:42:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:52:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:60:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:69:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c: In function 'omap_ehci_tll_reset': drivers/usb/host/ehci-omap.c:81:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:84:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c: In function 'omap_ehci_hcd_init': drivers/usb/host/ehci-omap.c:204:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:209:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:217:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:267:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/host/ehci-omap.c:284:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD drivers/usb/host/built-in.o LD drivers/usb/musb-new/built-in.o CC drivers/usb/musb/musb_udc.o CC drivers/usb/musb/musb_core.o CC drivers/usb/musb/omap3.o drivers/usb/musb/omap3.c: In function 'musb_platform_init': drivers/usb/musb/omap3.c:110:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/musb/omap3.c:114:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/musb/omap3.c:117:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] drivers/usb/musb/omap3.c:119:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD drivers/usb/musb/built-in.o LD drivers/usb/phy/built-in.o LD drivers/usb/ulpi/built-in.o CC fs/fs.o CC fs/ext4/ext4fs.o CC fs/ext4/ext4_common.o fs/ext4/ext4_common.c: In function 'ext4fs_iterate_dir': fs/ext4/ext4_common.c:2011:6: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] fs/ext4/ext4_common.c: In function 'ext4fs_mount': fs/ext4/ext4_common.c:2230:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] fs/ext4/ext4_common.c:2230:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat] CC fs/ext4/dev.o LD fs/ext4/built-in.o CC fs/fat/fat_write.o In file included from fs/fat/fat_write.c:18:0: fs/fat/fat.c: In function 'get_fatent': fs/fat/fat.c:187:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%d' expects argument of type 'int', but argument 6 has type '__u32' [-Wformat] fs/fat/fat.c:248:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:248:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_cluster': fs/fat/fat.c:272:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:272:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_contents': fs/fat/fat.c:353:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:383:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:399:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:426:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_dentfromdir': fs/fat/fat.c:639:10: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:695:8: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:717:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:726:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'do_fat_read_at': fs/fat/fat.c:877:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat] fs/fat/fat.c:917:4: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:979:10: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1036:8: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1059:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1160:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'get_fatent_value': fs/fat/fat_write.c:145:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%d' expects argument of type 'int', but argument 6 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'determine_fatent': fs/fat/fat_write.c:537:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:537:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'set_cluster': fs/fat/fat_write.c:560:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:560:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'set_contents': fs/fat/fat_write.c:697:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:742:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'find_directory_entry': fs/fat/fat_write.c:885:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:921:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] CC fs/fat/file.o LD fs/fat/built-in.o LD fs/built-in.o CC lib/libfdt/fdt.o CC lib/libfdt/fdt_ro.o CC lib/libfdt/fdt_rw.o CC lib/libfdt/fdt_strerror.o CC lib/libfdt/fdt_sw.o CC lib/libfdt/fdt_wip.o CC lib/libfdt/fdt_empty_tree.o CC lib/libfdt/fdt_addresses.o LD lib/libfdt/built-in.o CC lib/zlib/zlib.o LD lib/zlib/built-in.o CC lib/circbuf.o CC lib/crc7.o CC lib/crc8.o CC lib/crc16.o CC lib/gunzip.o CC lib/initcall.o CC lib/lmb.o CC lib/ldiv.o CC lib/net_utils.o CC lib/qsort.o CC lib/strmhz.o CC lib/list_sort.o CC lib/hashtable.o CC lib/errno.o CC lib/display_options.o lib/display_options.c: In function 'print_size': lib/display_options.c:42:3: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat] lib/display_options.c: In function 'print_buffer': lib/display_options.c:128:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] CC lib/crc32.o CC lib/ctype.o CC lib/div64.o CC lib/hang.o CC lib/linux_compat.o CC lib/linux_string.o CC lib/string.o CC lib/time.o CC lib/vsprintf.o LD lib/built-in.o CC net/arp.o CC net/bootp.o CC net/eth.o CC net/net.o CC net/ping.o CC net/tftp.o net/tftp.c: In function 'TftpStart': net/tftp.c:722:4: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] net/tftp.c:722:4: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat] net/tftp.c:722:4: warning: format '%X' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Wformat] net/tftp.c:722:4: warning: format '%X' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat] LD net/built-in.o LD test/built-in.o LD test/dm/built-in.o CC examples/standalone/hello_world.o CC examples/standalone/stubs.o LD examples/standalone/libstubs.o LD examples/standalone/hello_world OBJCOPY examples/standalone/hello_world.srec OBJCOPY examples/standalone/hello_world.bin LDS u-boot.lds LD u-boot OBJCOPY u-boot.bin MKIMAGE u-boot.img OBJCOPY u-boot.srec CC spl/arch/arm/cpu/armv7/cache_v7.o arch/arm/cpu/armv7/cache_v7.c: In function 'v7_dcache_inval_range': arch/arm/cpu/armv7/cache_v7.c:174:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/cache_v7.c:185:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] CC spl/arch/arm/cpu/armv7/cpu.o CC spl/arch/arm/cpu/armv7/syslib.o AS spl/arch/arm/cpu/armv7/lowlevel_init.o CC spl/arch/arm/cpu/armv7/omap-common/reset.o CC spl/arch/arm/cpu/armv7/omap-common/timer.o arch/arm/cpu/armv7/omap-common/timer.c: In function 'timer_init': arch/arm/cpu/armv7/omap-common/timer.c:39:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:41:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:45:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c: In function '__udelay': arch/arm/cpu/armv7/omap-common/timer.c:64:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c:67:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/timer.c: In function 'get_timer_masked': arch/arm/cpu/armv7/omap-common/timer.c:79:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC spl/arch/arm/cpu/armv7/omap-common/utils.o CC spl/arch/arm/cpu/armv7/omap-common/hwinit-common.o In file included from arch/arm/cpu/armv7/omap-common/hwinit-common.c:18:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'omap_rev_string': arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c:73:9: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'wait_for_command_complete': arch/arm/cpu/armv7/omap-common/hwinit-common.c:159:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c: In function 'watchdog_init': arch/arm/cpu/armv7/omap-common/hwinit-common.c:171:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/hwinit-common.c:173:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC spl/arch/arm/cpu/armv7/omap-common/clocks-common.o In file included from arch/arm/cpu/armv7/omap-common/clocks-common.c:24:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'setup_post_dividers': arch/arm/cpu/armv7/omap-common/clocks-common.c:80:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:82:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:84:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:86:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:88:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:90:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:92:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:94:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:96:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:98:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_bypass_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:105:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:105:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'wait_for_bypass': arch/arm/cpu/armv7/omap-common/clocks-common.c:117:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_lock_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:125:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:125:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'wait_for_lock': arch/arm/cpu/armv7/omap-common/clocks-common.c:136:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'check_for_lock': arch/arm/cpu/armv7/omap-common/clocks-common.c:144:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_setup_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:220:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:231:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:231:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:231:4: warning: format '%d' expects argument of type 'int', but argument 5 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:231:4: warning: format '%d' expects argument of type 'int', but argument 6 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:252:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'omap_ddr_clk': arch/arm/cpu/armv7/omap-common/clocks-common.c:276:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:298:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'configure_mpu_dpll': arch/arm/cpu/armv7/omap-common/clocks-common.c:332:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c:332:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'do_scale_vcore': arch/arm/cpu/armv7/omap-common/clocks-common.c:465:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:465:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:469:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'optimize_vcore_voltage': arch/arm/cpu/armv7/omap-common/clocks-common.c:492:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:498:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:498:10: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:502:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:502:2: warning: format '%d' expects argument of type 'int', but argument 5 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:502:2: warning: format '%d' expects argument of type 'int', but argument 6 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'enable_clock_domain': arch/arm/cpu/armv7/omap-common/clocks-common.c:549:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'wait_for_clk_enable': arch/arm/cpu/armv7/omap-common/clocks-common.c:565:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c:565:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/clocks-common.c: In function 'enable_clock_module': arch/arm/cpu/armv7/omap-common/clocks-common.c:576:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] CC spl/arch/arm/cpu/armv7/omap-common/emif-common.o In file included from arch/arm/cpu/armv7/omap-common/emif-common.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'set_lpmode_selfrefresh': arch/arm/cpu/armv7/omap-common/emif-common.c:27:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:31:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:34:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'get_mr': arch/arm/cpu/armv7/omap-common/emif-common.c:59:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:61:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:63:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:64:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'set_mr': arch/arm/cpu/armv7/omap-common/emif-common.c:79:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:80:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_reset_phy': arch/arm/cpu/armv7/omap-common/emif-common.c:88:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:90:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'lpddr2_init': arch/arm/cpu/armv7/omap-common/emif-common.c:129:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:129:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:135:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:135:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:141:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:142:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:150:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:151:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:154:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:154:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_update_timings': arch/arm/cpu/armv7/omap-common/emif-common.c:166:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:167:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:168:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:169:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:172:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:174:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:175:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:177:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:178:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:180:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:183:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:186:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:189:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'omap5_ddr3_leveling': arch/arm/cpu/armv7/omap-common/emif-common.c:199:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:211:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:214:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:218:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:222:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:225:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:235:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:241:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'ddr3_init': arch/arm/cpu/armv7/omap-common/emif-common.c:261:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:264:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:265:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:266:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:268:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:269:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:277:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:278:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:280:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:281:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:286:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'do_sdram_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1010:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1082:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'emif_post_init_config': arch/arm/cpu/armv7/omap-common/emif-common.c:1096:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'dmm_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1186:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1187:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1188:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1189:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1191:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1193:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1195:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1197:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1204:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1206:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1208:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c:1210:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'do_bug0039_workaround': arch/arm/cpu/armv7/omap-common/emif-common.c:1270:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/emif-common.c: In function 'sdram_init': arch/arm/cpu/armv7/omap-common/emif-common.c:1303:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1345:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] arch/arm/cpu/armv7/omap-common/emif-common.c:1345:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] CC spl/arch/arm/cpu/armv7/omap-common/vc.o CC spl/arch/arm/cpu/armv7/omap-common/abb.o CC spl/arch/arm/cpu/armv7/omap-common/omap-cache.o CC spl/arch/arm/cpu/armv7/omap-common/boot-common.o arch/arm/cpu/armv7/omap-common/boot-common.c: In function 'jump_to_image_no_args': arch/arm/cpu/armv7/omap-common/boot-common.c:141:2: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] AS spl/arch/arm/cpu/armv7/omap-common/lowlevel_init.o CC spl/arch/arm/cpu/armv7/omap-common/mem-common.o arch/arm/cpu/armv7/omap-common/mem-common.c: In function 'enable_gpmc_cs_config': arch/arm/cpu/armv7/omap-common/mem-common.c:56:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:59:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:60:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:61:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:62:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:63:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:64:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:66:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c: In function 'gpmc_init': arch/arm/cpu/armv7/omap-common/mem-common.c:126:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:127:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:128:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:130:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:134:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] arch/arm/cpu/armv7/omap-common/mem-common.c:139:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD spl/arch/arm/cpu/armv7/omap-common/built-in.o CC spl/arch/arm/cpu/armv7/omap4/sdram_elpida.o In file included from arch/arm/cpu/armv7/omap4/sdram_elpida.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC spl/arch/arm/cpu/armv7/omap4/hwinit.o In file included from arch/arm/cpu/armv7/omap4/hwinit.c:19:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC spl/arch/arm/cpu/armv7/omap4/emif.o In file included from arch/arm/cpu/armv7/omap4/emif.c:13:0: ./arch/arm/include/asm/emif.h: In function 'get_emif_rev': ./arch/arm/include/asm/emif.h:1165:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./arch/arm/include/asm/emif.h: In function 'emif_sdram_type': ./arch/arm/include/asm/emif.h:1179:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CC spl/arch/arm/cpu/armv7/omap4/prcm-regs.o CC spl/arch/arm/cpu/armv7/omap4/hw_data.o LD spl/arch/arm/cpu/armv7/omap4/built-in.o LD spl/arch/arm/cpu/armv7/built-in.o AS spl/arch/arm/cpu/armv7/start.o LD spl/arch/arm/cpu/built-in.o AS spl/arch/arm/lib/vectors.o AS spl/arch/arm/lib/crt0.o CC spl/arch/arm/lib/spl.o CC spl/arch/arm/lib/sections.o CC spl/arch/arm/lib/interrupts.o CC spl/arch/arm/lib/reset.o CC spl/arch/arm/lib/cache.o CC spl/arch/arm/lib/cache-cp15.o LD spl/arch/arm/lib/built-in.o AR spl/arch/arm/lib/lib.a CC spl/arch/arm/lib/eabi_compat.o CC spl/board/ti/panda/panda.o board/ti/panda/panda.c: In function 'misc_init_r': board/ti/panda/panda.c:211:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:221:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:226:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:236:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:239:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] board/ti/panda/panda.c:248:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] LD spl/board/ti/panda/built-in.o CC spl/common/spl/spl.o common/spl/spl.c: In function 'spl_parse_image_header': common/spl/spl.c:100:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'u32' [-Wformat] common/spl/spl.c:100:3: warning: format '%d' expects argument of type 'int', but argument 5 has type 'u32' [-Wformat] common/spl/spl.c:105:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__be32' [-Wformat] common/spl/spl.c: In function 'jump_to_image_no_args': common/spl/spl.c:118:2: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'u32' [-Wformat] common/spl/spl.c: In function 'board_init_r': common/spl/spl.c:169:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] common/spl/spl.c:234:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u32' [-Wformat] CC spl/common/spl/spl_mmc.o CC spl/common/spl/spl_fat.o CC spl/common/spl/spl_ext.o common/spl/spl_ext.c: In function 'spl_load_image_ext': common/spl/spl_ext.c:35:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 's32' [-Wformat] common/spl/spl_ext.c:59:10: warning: format '%d' expects argument of type 'int', but argument 4 has type 's32' [-Wformat] LD spl/common/spl/built-in.o CC spl/common/cmd_nvedit.o CC spl/common/env_common.o CC spl/common/console.o CC spl/common/dlmalloc.o CC spl/common/image.o common/image.c: In function 'image_print_contents': common/image.c:308:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/image.c:309:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] common/image.c: In function 'genimg_print_size': common/image.c:505:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] CC spl/common/image-fdt.o CC spl/common/memsize.o CC spl/common/stdio.o CC spl/common/cli_simple.o CC spl/common/cli.o CC spl/common/cli_readline.o CC spl/common/command.o CC spl/common/s_record.o CC spl/common/xyzModem.o CC spl/common/cmd_disk.o LD spl/common/built-in.o CC spl/disk/part.o CC spl/disk/part_dos.o LD spl/disk/built-in.o LD spl/drivers/i2c/built-in.o CC spl/drivers/gpio/omap_gpio.o LD spl/drivers/gpio/built-in.o CC spl/drivers/mmc/mmc.o CC spl/drivers/mmc/omap_hsmmc.o drivers/mmc/omap_hsmmc.c: In function 'mmc_reset_controller_fsm': drivers/mmc/omap_hsmmc.c:308:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_send_cmd': drivers/mmc/omap_hsmmc.c:335:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32' [-Wformat] LD spl/drivers/mmc/built-in.o CC spl/drivers/serial/serial.o CC spl/drivers/serial/serial_ns16550.o CC spl/drivers/serial/ns16550.o LD spl/drivers/serial/built-in.o CC spl/fs/ext4/ext4fs.o CC spl/fs/ext4/ext4_common.o fs/ext4/ext4_common.c: In function 'ext4fs_iterate_dir': fs/ext4/ext4_common.c:2011:6: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] fs/ext4/ext4_common.c: In function 'ext4fs_mount': fs/ext4/ext4_common.c:2230:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat] fs/ext4/ext4_common.c:2230:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat] CC spl/fs/ext4/dev.o LD spl/fs/ext4/built-in.o CC spl/fs/fat/fat_write.o In file included from fs/fat/fat_write.c:18:0: fs/fat/fat.c: In function 'get_fatent': fs/fat/fat.c:187:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat.c:187:2: warning: format '%d' expects argument of type 'int', but argument 6 has type '__u32' [-Wformat] fs/fat/fat.c:248:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:248:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_cluster': fs/fat/fat.c:272:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:272:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_contents': fs/fat/fat.c:353:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:383:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:399:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:426:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'get_dentfromdir': fs/fat/fat.c:639:10: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:695:8: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:717:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:726:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c: In function 'do_fat_read_at': fs/fat/fat.c:877:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat.c:879:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat] fs/fat/fat.c:917:4: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:979:10: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1036:8: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1059:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat.c:1160:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'get_fatent_value': fs/fat/fat_write.c:145:3: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%d' expects argument of type 'int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat_write.c:168:2: warning: format '%d' expects argument of type 'int', but argument 6 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c:236:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'determine_fatent': fs/fat/fat_write.c:537:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c:537:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'set_cluster': fs/fat/fat_write.c:560:2: warning: format '%d' expects argument of type 'int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:560:2: warning: format '%d' expects argument of type 'int', but argument 3 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'set_contents': fs/fat/fat_write.c:697:5: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:742:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c: In function 'find_directory_entry': fs/fat/fat_write.c:885:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] fs/fat/fat_write.c:921:4: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type '__u32' [-Wformat] LD spl/fs/fat/built-in.o LD spl/fs/built-in.o CC spl/lib/hashtable.o CC spl/lib/errno.o CC spl/lib/display_options.o lib/display_options.c: In function 'print_size': lib/display_options.c:42:3: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat] lib/display_options.c: In function 'print_buffer': lib/display_options.c:128:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] CC spl/lib/crc32.o CC spl/lib/ctype.o CC spl/lib/div64.o CC spl/lib/hang.o CC spl/lib/linux_compat.o CC spl/lib/linux_string.o CC spl/lib/string.o CC spl/lib/time.o CC spl/lib/vsprintf.o LD spl/lib/built-in.o LDS spl/u-boot-spl.lds LD spl/u-boot-spl OBJCOPY spl/u-boot-spl.bin MKIMAGE MLO
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
fs/fat/fat.c | 35 ++++++++++++++++++----------------- include/u-boot/zlib.h | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 04a51db..d473e17 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -9,6 +9,7 @@ * SPDX-License-Identifier: GPL-2.0+ */
+#include <inttypes.h> #include <common.h> #include <config.h> #include <exports.h> @@ -184,7 +185,7 @@ static __u32 get_fatent(fsdata *mydata, __u32 entry) return ret; }
- debug("FAT%d: entry: 0x%04x = %d, offset: 0x%04x = %d\n", + debug("FAT%d: entry: 0x%04" PRIx32 " = %" PRId32 ", offset: 0x%04" PRIx32 " = %" PRId32 "\n", mydata->fatsize, entry, entry, offset, offset);
/* Read a new block of FAT entries into the cache. */ @@ -245,7 +246,7 @@ static __u32 get_fatent(fsdata *mydata, __u32 entry) } break; } - debug("FAT%d: ret: %08x, offset: %04x\n", + debug("FAT%d: ret: %08" PRIx32 ", offset: %04" PRIx32 "\n", mydata->fatsize, ret, offset);
return ret; @@ -269,7 +270,7 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) startsect = mydata->rootdir_sect; }
- debug("gc - clustnum: %d, startsect: %d\n", clustnum, startsect); + debug("gc - clustnum: %" PRId32 ", startsect: %" PRId32 "\n", clustnum, startsect);
if ((unsigned long)buffer & (ARCH_DMA_MINALIGN - 1)) { ALLOC_CACHE_ALIGN_BUFFER(__u8, tmpbuf, mydata->sect_size); @@ -350,7 +351,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, while (actsize <= pos) { curclust = get_fatent(mydata, curclust); if (CHECK_CLUST(curclust, mydata->fatsize)) { - debug("curclust: 0x%x\n", curclust); + debug("curclust: 0x%" PRIx32 "\n", curclust); debug("Invalid FAT entry\n"); return 0; } @@ -380,7 +381,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
curclust = get_fatent(mydata, curclust); if (CHECK_CLUST(curclust, mydata->fatsize)) { - debug("curclust: 0x%x\n", curclust); + debug("curclust: 0x%" PRIx32 "\n", curclust); debug("Invalid FAT entry\n"); return 0; } @@ -396,7 +397,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, if ((newclust - 1) != endclust) goto getit; if (CHECK_CLUST(newclust, mydata->fatsize)) { - debug("curclust: 0x%x\n", newclust); + debug("curclust: 0x%" PRIx32 "\n", newclust); debug("Invalid FAT entry\n"); return 0; } @@ -423,7 +424,7 @@ getit:
curclust = get_fatent(mydata, endclust); if (CHECK_CLUST(curclust, mydata->fatsize)) { - debug("curclust: 0x%x\n", curclust); + debug("curclust: 0x%" PRIx32 "\n", curclust); printf("Invalid FAT entry\n"); return 0; } @@ -633,7 +634,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect, } if (doit) { if (dirc == ' ') { - printf(" %8u %s%c\n", + printf(" %8" PRIu32 "%s%c\n", FAT2CPU32(dentptr->size), l_name, dirc); @@ -690,7 +691,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
if (doit) { if (dirc == ' ') { - printf(" %8u %s%c\n", + printf(" %8" PRIu32 "%s%c\n", FAT2CPU32(dentptr->size), s_name, dirc); } else { @@ -714,7 +715,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
debug("DentName: %s", s_name); debug(", start: 0x%x", START(dentptr)); - debug(", size: 0x%x %s\n", + debug(", size: 0x%" PRIx32 " %s\n", FAT2CPU32(dentptr->size), (dentptr->attr & ATTR_DIR) ? "(DIR)" : "");
@@ -723,7 +724,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
curclust = get_fatent(mydata, curclust); if (CHECK_CLUST(curclust, mydata->fatsize)) { - debug("curclust: 0x%x\n", curclust); + debug("curclust: 0x%" PRIx32 "\n", curclust); printf("Invalid FAT entry\n"); return NULL; } @@ -874,7 +875,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, if (vfat_enabled) debug("VFAT Support enabled\n");
- debug("FAT%d, fat_sect: %d, fatlength: %d\n", + debug("FAT%d, fat_sect: %d, fatlength: %" PRId32 "\n", mydata->fatsize, mydata->fat_sect, mydata->fatlength); debug("Rootdir begins at cluster: %d, sector: %d, offset: %x\n" "Data begins at: %d\n", @@ -914,7 +915,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, int i;
if (j == 0) { - debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%zd\n", + debug("FAT read sect=%" PRId32 ", clust_size=%d, DIRENTSPERBLOCK=%zd\n", cursect, mydata->clust_size, DIRENTSPERBLOCK);
if (disk_read(cursect, @@ -973,7 +974,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, } if (doit) { if (dirc == ' ') { - printf(" %8u %s%c\n", + printf(" %8" PRIu32 " %s%c\n", FAT2CPU32(dentptr->size), l_name, dirc); @@ -1031,7 +1032,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer, } if (doit) { if (dirc == ' ') { - printf(" %8u %s%c\n", + printf(" %8" PRIu32 " %s%c\n", FAT2CPU32(dentptr->size), s_name, dirc); } else { @@ -1056,7 +1057,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
debug("RootName: %s", s_name); debug(", start: 0x%x", START(dentptr)); - debug(", size: 0x%x %s\n", + debug(", size: 0x%" PRIx32 " %s\n", FAT2CPU32(dentptr->size), isdir ? "(DIR)" : "");
@@ -1157,7 +1158,7 @@ rootdir_done: } else { ret = get_contents(mydata, dentptr, pos, buffer, maxsize, size); } - debug("Size: %u, got: %llu\n", FAT2CPU32(dentptr->size), *size); + debug("Size: %" PRIu32 ", got: %llu\n", FAT2CPU32(dentptr->size), *size);
exit: free(mydata->fatbuf); diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h index e23ceb5..bf09b6f 100644 --- a/include/u-boot/zlib.h +++ b/include/u-boot/zlib.h @@ -694,7 +694,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. */
-ZEXTERN uInt ZEXPORT crc32 OF((uInt crc, const Bytef *buf, uInt len)); +ZEXTERN uint32_t ZEXPORT crc32 OF((uint32_t crc, const Bytef *buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is NULL, this function returns the required initial

Hi Masahiro,
On 22 December 2014 at 03:16, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If <stdint.h> is included, the definition of fixed-width types are compiler-dependent.
For example, some compilers use "unsigned long" and some compilers use "unsigned int" for 32bit width typedefs.
That means, we can no longer use hard-code "%x" or "%d" to print 32bit-width variables.
We use printf() everywhere to print 32bit variables.
This commit only fixes fs/fat/fat.c because I cannot imagine how many days I have to spend to eliminate all the warnings. (Of course, I do not think we should do such ridiculous things.)
Just in case, I put the warnings I got for Panda board below:
Yes indeed, this patch is ugly. We need to keep 32-bit types consistent. I felt it was possible to live with 64-bit types being inconsistent because 64-bit printf()s are so rare. But it would be better to avoid the inconsistency altogether.
Regards, Simon

Linux expects "unsigned long" has the same bit-width as the pointer, i.e. the size of "unsigned long" is 4 on 32-bit compilers (ILP32) and it is 8 on 64-bit compilers (LLP64). It provides us the convenience in return of the limitation that LP64 data model is not supported.
U-Boot used to follow Linux's way, but it does not now.
Including <stdint.h> means the width of "long" type is provided by the compiler.
Use __SIZEOF_LONG__ instead of hard-coding BITS_PER_LONG.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com ---
arch/arc/include/asm/types.h | 4 ++++ arch/arm/include/asm/types.h | 4 ++++ arch/avr32/include/asm/types.h | 4 ++++ arch/blackfin/include/asm/types.h | 4 ++++ arch/m68k/include/asm/types.h | 4 ++++ arch/microblaze/include/asm/types.h | 4 ++++ arch/mips/include/asm/types.h | 4 ++++ arch/nds32/include/asm/types.h | 4 ++++ arch/nios2/include/asm/types.h | 4 ++++ arch/openrisc/include/asm/types.h | 4 ++++ arch/powerpc/include/asm/types.h | 4 ++++ arch/sandbox/include/asm/types.h | 4 ++++ arch/sh/include/asm/types.h | 4 ++++ arch/sparc/include/asm/types.h | 4 ++++ arch/x86/include/asm/types.h | 4 ++++ 15 files changed, 60 insertions(+)
diff --git a/arch/arc/include/asm/types.h b/arch/arc/include/asm/types.h index 5693e5f..71779e9 100644 --- a/arch/arc/include/asm/types.h +++ b/arch/arc/include/asm/types.h @@ -73,7 +73,11 @@ typedef signed long long s64; typedef unsigned long long u64; #endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index e24acc59..510b694 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -72,11 +72,15 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #ifdef CONFIG_ARM64 #define BITS_PER_LONG 64 #else /* CONFIG_ARM64 */ #define BITS_PER_LONG 32 #endif /* CONFIG_ARM64 */ +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/avr32/include/asm/types.h b/arch/avr32/include/asm/types.h index 032a765..5311daa 100644 --- a/arch/avr32/include/asm/types.h +++ b/arch/avr32/include/asm/types.h @@ -51,7 +51,11 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
#ifndef __ASSEMBLY__
diff --git a/arch/blackfin/include/asm/types.h b/arch/blackfin/include/asm/types.h index 8cae642..2cdb0e8 100644 --- a/arch/blackfin/include/asm/types.h +++ b/arch/blackfin/include/asm/types.h @@ -88,7 +88,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h index 83de4d5..53414db 100644 --- a/arch/m68k/include/asm/types.h +++ b/arch/m68k/include/asm/types.h @@ -72,7 +72,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h index afcd811..7418499 100644 --- a/arch/microblaze/include/asm/types.h +++ b/arch/microblaze/include/asm/types.h @@ -79,7 +79,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h index f372c70..546a9c1 100644 --- a/arch/mips/include/asm/types.h +++ b/arch/mips/include/asm/types.h @@ -58,7 +58,11 @@ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG _MIPS_SZLONG +#endif
#ifndef __ASSEMBLY__
diff --git a/arch/nds32/include/asm/types.h b/arch/nds32/include/asm/types.h index 8416cef..6d0a2db 100644 --- a/arch/nds32/include/asm/types.h +++ b/arch/nds32/include/asm/types.h @@ -79,7 +79,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
#include <stddef.h>
diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index 43c76cc..d5751e2 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -78,7 +78,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 069c8d6..16a0ad9 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -84,7 +84,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index 71868ef..cba487c 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -71,7 +71,11 @@ typedef unsigned long long u64;
#endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
#ifdef CONFIG_PHYS_64BIT typedef unsigned long long dma_addr_t; diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 1bb168c..6d69422 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -80,7 +80,11 @@ typedef __INT64_TYPE__ s64; typedef __UINT64_TYPE__ u64; #endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG CONFIG_SANDBOX_BITS_PER_LONG +#endif
typedef unsigned long dma_addr_t; typedef u32 phys_addr_t; diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h index eb47b0f..82884f4 100644 --- a/arch/sh/include/asm/types.h +++ b/arch/sh/include/asm/types.h @@ -46,7 +46,11 @@ __extension__ typedef unsigned long long __u64; */ #ifdef __KERNEL__
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
#ifndef __ASSEMBLY__
diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h index 79484c5..5794152 100644 --- a/arch/sparc/include/asm/types.h +++ b/arch/sparc/include/asm/types.h @@ -77,7 +77,11 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64;
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index 88c6645..7ff1520 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -75,7 +75,11 @@ typedef __INT64_TYPE__ s64; typedef __UINT64_TYPE__ u64; #endif
+#ifdef CONFIG_USE_STDINT +#define BITS_PER_LONG ((__SIZEOF_LONG__) * 8) +#else #define BITS_PER_LONG 32 +#endif
/* Dma addresses are 32-bits wide. */

Hi Masahiro,
On 22 December 2014 at 03:16, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
Linux expects "unsigned long" has the same bit-width as the pointer, i.e. the size of "unsigned long" is 4 on 32-bit compilers (ILP32) and it is 8 on 64-bit compilers (LLP64). It provides us the convenience in return of the limitation that LP64 data model is not supported.
U-Boot used to follow Linux's way, but it does not now.
Including <stdint.h> means the width of "long" type is provided by the compiler.
Use __SIZEOF_LONG__ instead of hard-coding BITS_PER_LONG.
From what I can tell the size of the types is no different with and
without stdint.h. It is just the names of the typedefs that are used for each type that changes. So if we follow the kernel approach, maybe this patch isn't needed either?
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Gabe Black gabeblack@chromium.org Cc: Simon Glass sjg@chromium.org Cc: Bill Richardson wfrichar@google.com Cc: Tom Rini trini@ti.com
arch/arc/include/asm/types.h | 4 ++++ arch/arm/include/asm/types.h | 4 ++++ arch/avr32/include/asm/types.h | 4 ++++ arch/blackfin/include/asm/types.h | 4 ++++ arch/m68k/include/asm/types.h | 4 ++++ arch/microblaze/include/asm/types.h | 4 ++++ arch/mips/include/asm/types.h | 4 ++++ arch/nds32/include/asm/types.h | 4 ++++ arch/nios2/include/asm/types.h | 4 ++++ arch/openrisc/include/asm/types.h | 4 ++++ arch/powerpc/include/asm/types.h | 4 ++++ arch/sandbox/include/asm/types.h | 4 ++++ arch/sh/include/asm/types.h | 4 ++++ arch/sparc/include/asm/types.h | 4 ++++ arch/x86/include/asm/types.h | 4 ++++ 15 files changed, 60 insertions(+)
[snip]
Regards, Simon

Dear Masahiro,
In message 1419243363-11542-1-git-send-email-yamada.m@jp.panasonic.com you wrote:
Commit 0d296cc2d3b (Provide option to avoid defining a custome version of uintptr_t) and commit 4166ecb247 (Add some standard headers external code might need) made a horrible decision.
I fully agree with that statement.
It looks like Simon is not understanding me. Nor does anybody else have any interest in this topic.
Sorry, I missed that, largely for personal reasons (resulting in even harder than usual lack of time).
This series is here to show what will happen next and how horrible it is.
Yes, it is horrible, and we should not do that. I just commented on patch 5/7, but the applies to the whole series:
We should reconsider the aforementioned commits (read: revert and/or replace with a more sensible implementation).
We should really make sure to 1) keep the code readable and 2) especially keep the code compatible with Linux coding.
Best regards,
Wolfgang Denk
participants (3)
-
Masahiro Yamada
-
Simon Glass
-
Wolfgang Denk