mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1
@ 2020-04-15  7:59 Masahiro Yamada
  2020-04-15  9:40 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2020-04-15  7:59 UTC (permalink / raw)
  To: barebox; +Cc: Masahiro Yamada

Fix the relative include path in <linux/libfdt.h>

Including <linux/kernel.h> is too much. <linux/limits.h> is enough
for INT_MAX.

Define INT32_MAX and UINT32_MAX in the same way as Linux does.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 include/linux/libfdt.h     | 2 +-
 include/linux/libfdt_env.h | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/libfdt.h b/include/linux/libfdt.h
index ef2467213..90ed4ebfa 100644
--- a/include/linux/libfdt.h
+++ b/include/linux/libfdt.h
@@ -3,6 +3,6 @@
 #define _INCLUDE_LIBFDT_H_
 
 #include <linux/libfdt_env.h>
-#include "../scripts/dtc/libfdt/libfdt.h"
+#include "../../scripts/dtc/libfdt/libfdt.h"
 
 #endif /* _INCLUDE_LIBFDT_H_ */
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
index bac4670d6..cea8574a2 100644
--- a/include/linux/libfdt_env.h
+++ b/include/linux/libfdt_env.h
@@ -2,11 +2,14 @@
 #ifndef LIBFDT_ENV_H
 #define LIBFDT_ENV_H
 
-#include <linux/kernel.h>	/* For INT_MAX */
+#include <linux/limits.h>	/* For INT_MAX */
 #include <linux/string.h>
 
 #include <asm/byteorder.h>
 
+#define INT32_MAX	S32_MAX
+#define UINT32_MAX	U32_MAX
+
 typedef __be16 fdt16_t;
 typedef __be32 fdt32_t;
 typedef __be64 fdt64_t;
@@ -16,6 +19,4 @@ typedef __be64 fdt64_t;
 #define fdt64_to_cpu(x) be64_to_cpu(x)
 #define cpu_to_fdt64(x) cpu_to_be64(x)
 
-#define INT32_MAX	2147483647
-
 #endif /* LIBFDT_ENV_H */
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2020-04-16  6:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15  7:59 [PATCH] libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1 Masahiro Yamada
2020-04-15  9:40 ` Sascha Hauer
2020-04-15 10:54   ` Masahiro Yamada
2020-04-16  6:35     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox