1From 086283ed7f1886de05407bc75dd4c070c78a6f50 Mon Sep 17 00:00:00 2001 2From: Lothar Felten <lothar.felten@gmail.com> 3Date: Mon, 8 Oct 2018 13:29:44 +0200 4Subject: [PATCH] Fix include guards for older kernel/u-boot sources 5 6Linux kernels before 4.17 and U-Boot versions before 2018.07 use libfdt 7include guards with leading underscores. 8 9Those have been removed in dtc-1.4.7. 10 11This patch handles both include guard types and allows the compilation 12of older Linux kernel and u-boot sources. 13 14Signed-off-by: Lothar Felten <lothar.felten@gmail.com> 15[ThomasDS: also update fdt.h which has the same issue, seen on U-Boot 162011.03] 17Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> 18[SB: Updated to match context change in v1.5.1] 19Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> 20--- 21 libfdt/fdt.h | 4 ++++ 22 libfdt/libfdt.h | 4 ++++ 23 libfdt/libfdt_env.h | 4 ++++ 24 3 files changed, 12 insertions(+) 25 26diff --git a/libfdt/fdt.h b/libfdt/fdt.h 27index f2e6880..0f1dc4d 100644 28--- a/libfdt/fdt.h 29+++ b/libfdt/fdt.h 30@@ -1,4 +1,8 @@ 31 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 32+#ifdef _FDT_H 33+#warning "Please consider updating your kernel and/or u-boot version" 34+#define FDT_H 35+#endif 36 #ifndef FDT_H 37 #define FDT_H 38 /* 39diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h 40index 8037f39..7668432 100644 41--- a/libfdt/libfdt.h 42+++ b/libfdt/libfdt.h 43@@ -1,4 +1,8 @@ 44 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 45+#ifdef _LIBFDT_H 46+#warning "Please consider updating your kernel and/or u-boot version" 47+#define LIBFDT_H 48+#endif 49 #ifndef LIBFDT_H 50 #define LIBFDT_H 51 /* 52diff --git a/libfdt/libfdt_env.h b/libfdt/libfdt_env.h 53index 73b6d40..b95a287 100644 54--- a/libfdt/libfdt_env.h 55+++ b/libfdt/libfdt_env.h 56@@ -1,4 +1,8 @@ 57 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 58+#ifdef _LIBFDT_ENV_H 59+#warning "Please consider updating your kernel and/or u-boot version" 60+#define LIBFDT_ENV_H 61+#endif 62 #ifndef LIBFDT_ENV_H 63 #define LIBFDT_ENV_H 64 /* 65-- 662.22.0.216.g00a2a96fc9 67 68