0001-Fix-include-guards-for-older-kernel-u-boot-sources.patch 2.0 KB

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