Skip to contentSkip to conversation

libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1

PATCH Applied Masahiro Yamada 2 participants 4 messages Apr 15, 2020 – Apr 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdt: update <linux/libfdt.h> and <linux/libfdt_env.h> to Linux 5.7-rc1

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.

---

 include/linux/libfdt.h     | 2 +-
 include/linux/libfdt_env.h | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
include/linux/libfdt.h +1 -1
index ef2467213..90ed4ebfa 100644
@@ -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_ */
include/linux/libfdt_env.h +4 -3
index bac4670d6..cea8574a2 100644
@@ -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 */
Signature · 7 lines
2.25.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 5 lines · 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.

Quoted 8 lines

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

---

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

Applied, thanks.

include/linux/libfdt.h line 6

Quoted 11 lines
include/linux/libfdt.h +1 -1
index ef2467213..90ed4ebfa 100644
@@ -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"

I wonder why this obviously wrong path worked before.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 26 lines · Sascha Hauer
Quoted 5 lines · 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.

Quoted 8 lines

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

---

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

Applied, thanks.

Quoted 8 lines
include/linux/libfdt.h +0 -0
index ef2467213..90ed4ebfa 100644
@@ -3,6 +3,6 @@
 #define _INCLUDE_LIBFDT_H_
 
Quoted 5 lines

include/linux/libfdt.h line 6

Quoted 3 lines
include/linux/libfdt.h +1 -1
 #include <linux/libfdt_env.h>
-#include "../scripts/dtc/libfdt/libfdt.h"
+#include "../../scripts/dtc/libfdt/libfdt.h"

I wonder why this obviously wrong path worked before.

This is because the $(srctree)/include/
is added to the header search paths.

The top Makefile defines it as follows:

LINUXINCLUDE    := -Iinclude -I$(srctree)/dts/include \
                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
                   -I$(srctree)/arch/$(ARCH)/include \
                   -I$(objtree)/arch/$(ARCH)/include \
                   -include $(srctree)/include/linux/kconfig.h

The previous "../scripts/dtc/libfdt/libfdt.h" works because it is relative to $(srctree)/include/

---
Best Regards
Masahiro Yamada

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 48 lines · Masahiro Yamada
Quoted 26 lines · Sascha Hauer
Quoted 5 lines · 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.

Quoted 8 lines

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

---

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

Applied, thanks.

Quoted 8 lines
include/linux/libfdt.h +0 -0
index ef2467213..90ed4ebfa 100644
@@ -3,6 +3,6 @@
 #define _INCLUDE_LIBFDT_H_
 
Quoted 5 lines

include/linux/libfdt.h line 6

Quoted 3 lines
include/linux/libfdt.h +1 -1
 #include <linux/libfdt_env.h>
-#include "../scripts/dtc/libfdt/libfdt.h"
+#include "../../scripts/dtc/libfdt/libfdt.h"

I wonder why this obviously wrong path worked before.

This is because the $(srctree)/include/
is added to the header search paths.

The top Makefile defines it as follows:

LINUXINCLUDE    := -Iinclude -I$(srctree)/dts/include \
                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
                   -I$(srctree)/arch/$(ARCH)/include \
                   -I$(objtree)/arch/$(ARCH)/include \
                   -include $(srctree)/include/linux/kconfig.h
Quoted 2 lines

The previous "../scripts/dtc/libfdt/libfdt.h" works because it is relative to $(srctree)/include/

Ah, "file" falls back to <file> when file is not found in the relative path. I tend to forget that.

Regards,
Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox