diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-11-13 16:12:02 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-04 19:13:15 +0100 |
commit | 5772cc668cea95433f96a6e0c1e777a0c1d2e745 (patch) | |
tree | 19a89d35177ac816b849e7a6adb81608dd15d006 /arch/powerpc/boot | |
parent | a5867bb197d4f4052498b9fc62fe098f7d70db1a (diff) | |
download | linux-stable-5772cc668cea95433f96a6e0c1e777a0c1d2e745.tar.gz linux-stable-5772cc668cea95433f96a6e0c1e777a0c1d2e745.tar.bz2 linux-stable-5772cc668cea95433f96a6e0c1e777a0c1d2e745.zip |
libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h
[ Upstream commit a8de1304b7df30e3a14f2a8b9709bb4ff31a0385 ]
The DTC v1.5.1 added references to (U)INT32_MAX.
This is no problem for user-space programs since <stdint.h> defines
(U)INT32_MAX along with (u)int32_t.
For the kernel space, libfdt_env.h needs to be adjusted before we
pull in the changes.
In the kernel, we usually use s/u32 instead of (u)int32_t for the
fixed-width types.
Accordingly, we already have S/U32_MAX for their max values.
So, we should not add (U)INT32_MAX to <linux/limits.h> any more.
Instead, add them to the in-kernel libfdt_env.h to compile the
latest libfdt.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r-- | arch/powerpc/boot/libfdt_env.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/boot/libfdt_env.h b/arch/powerpc/boot/libfdt_env.h index 2abc8e83b95e..9757d4f6331e 100644 --- a/arch/powerpc/boot/libfdt_env.h +++ b/arch/powerpc/boot/libfdt_env.h @@ -6,6 +6,8 @@ #include <string.h> #define INT_MAX ((int)(~0U>>1)) +#define UINT32_MAX ((u32)~0U) +#define INT32_MAX ((s32)(UINT32_MAX >> 1)) #include "of.h" |