aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-12-14 07:16:54 -0500
committerTom Rini <trini@konsulko.com>2023-12-21 08:54:05 -0500
commitb106961c2e4e7f339485a401ebb06c936fc432ee (patch)
tree693c4c75846facad25f28403431ac089c0540e31 /boot
parent36d3db6c2c060ee85176156dc9a607e8cd5465f4 (diff)
downloadu-boot-b106961c2e4e7f339485a401ebb06c936fc432ee.zip
u-boot-b106961c2e4e7f339485a401ebb06c936fc432ee.tar.gz
u-boot-b106961c2e4e7f339485a401ebb06c936fc432ee.tar.bz2
global: Restrict use of '#include <linux/kconfig.h>'
In general terms, we -include include/linux/kconfig.h and so normal U-Boot code does not need to also #include it. However, for code which is shared with userspace we may need to add it so that either our full config is available or so that macros such as CONFIG_IS_ENABLED() can be evaluated. In this case make sure that we guard these includes with a test for USE_HOSTCC so that it clear as to why we're doing this. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'boot')
-rw-r--r--boot/image-fit.c2
-rw-r--r--boot/image.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/boot/image-fit.c b/boot/image-fit.c
index 3cc556b..89e3775 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -15,6 +15,7 @@
#include <time.h>
#include <linux/libfdt.h>
#include <u-boot/crc.h>
+#include <linux/kconfig.h>
#else
#include <linux/compiler.h>
#include <linux/sizes.h>
@@ -36,7 +37,6 @@ DECLARE_GLOBAL_DATA_PTR;
#include <bootm.h>
#include <image.h>
#include <bootstage.h>
-#include <linux/kconfig.h>
#include <u-boot/crc.h>
#include <u-boot/md5.h>
#include <u-boot/sha1.h>
diff --git a/boot/image.c b/boot/image.c
index 675b5dd..073931c 100644
--- a/boot/image.c
+++ b/boot/image.c
@@ -42,6 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;
#else /* USE_HOSTCC */
#include "mkimage.h"
+#include <linux/kconfig.h>
#include <u-boot/md5.h>
#include <time.h>
@@ -62,7 +63,6 @@ DECLARE_GLOBAL_DATA_PTR;
#include <relocate.h>
#include <linux/lzo.h>
#include <linux/zstd.h>
-#include <linux/kconfig.h>
#include <lzma/LzmaTypes.h>
#include <lzma/LzmaDec.h>
#include <lzma/LzmaTools.h>