aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-12-13 17:52:04 -0500
committerTom Rini <trini@konsulko.com>2023-12-13 17:52:04 -0500
commit062cc777fff40214a1727f0695d71144edbbcc06 (patch)
tree10b449d5ecc06fd609a7a9e1f79fa8fc59cf1dc7
parent61875bdea35f799a4c024d2c8fa36c258c4b7f49 (diff)
downloadu-boot-TEST/remove-linux-kconfigh-inclusions.zip
u-boot-TEST/remove-linux-kconfigh-inclusions.tar.gz
u-boot-TEST/remove-linux-kconfigh-inclusions.tar.bz2
global: Restrict use of '#include <linux/kconfig.h>'TEST/remove-linux-kconfigh-inclusions
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. Signed-off-by: Tom Rini <trini@konsulko.com> --- Cc: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/arm/include/asm/arch-fsl-layerscape/config.h1
-rw-r--r--arch/arm/mach-rockchip/tpl.c1
-rw-r--r--arch/arm/mach-sunxi/dram_sun50i_h6.c1
-rw-r--r--arch/arm/mach-sunxi/dram_sun50i_h616.c1
-rw-r--r--arch/arm/mach-sunxi/dram_sunxi_dw.c1
-rw-r--r--boot/image-fit.c2
-rw-r--r--boot/image.c2
-rw-r--r--drivers/timer/dw-apb-timer.c1
-rw-r--r--env/embedded.c2
-rw-r--r--include/bootstage.h2
-rw-r--r--include/configs/at91-sama5_common.h2
-rw-r--r--include/configs/tqma6.h1
-rw-r--r--include/env_internal.h1
-rw-r--r--include/u-boot/ecdsa.h1
-rw-r--r--lib/rsa/rsa-verify.c2
-rw-r--r--test/dm/scmi.c1
-rw-r--r--tools/binman/test/blob_syms.c1
-rw-r--r--tools/binman/test/u_boot_binman_syms.c1
-rw-r--r--tools/binman/test/u_boot_binman_syms_size.c1
-rw-r--r--tools/envcrc.c2
-rw-r--r--tools/mkeficapsule.c1
21 files changed, 5 insertions, 23 deletions
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h b/arch/arm/include/asm/arch-fsl-layerscape/config.h
index 516c9ea..faace43 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
@@ -7,7 +7,6 @@
#ifndef _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
#define _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
-#include <linux/kconfig.h>
#include <fsl_ddrc_version.h>
#ifndef __ASSEMBLY__
diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index fdd0c59..2c3e978 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -16,7 +16,6 @@
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
#include <linux/bitops.h>
-#include <linux/kconfig.h>
#if CONFIG_IS_ENABLED(BANNER_PRINT)
#include <timestamp.h>
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h6.c b/arch/arm/mach-sunxi/dram_sun50i_h6.c
index bff2e42..62bc2a0 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h6.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h6.c
@@ -15,7 +15,6 @@
#include <asm/arch/prcm.h>
#include <linux/bitops.h>
#include <linux/delay.h>
-#include <linux/kconfig.h>
/*
* The DRAM controller structure on H6 is similar to the ones on A23/A80:
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index c5c1331..e62d571 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -22,7 +22,6 @@
#include <asm/arch/prcm.h>
#include <linux/bitops.h>
#include <linux/delay.h>
-#include <linux/kconfig.h>
enum {
MBUS_QOS_LOWEST = 0,
diff --git a/arch/arm/mach-sunxi/dram_sunxi_dw.c b/arch/arm/mach-sunxi/dram_sunxi_dw.c
index 9382d3d..daef051 100644
--- a/arch/arm/mach-sunxi/dram_sunxi_dw.c
+++ b/arch/arm/mach-sunxi/dram_sunxi_dw.c
@@ -16,7 +16,6 @@
#include <asm/arch/dram.h>
#include <asm/arch/cpu.h>
#include <linux/delay.h>
-#include <linux/kconfig.h>
static void mctl_phy_init(u32 val)
{
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 88b67bc..fed5dda 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>
diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
index b171232..6cd2525 100644
--- a/drivers/timer/dw-apb-timer.c
+++ b/drivers/timer/dw-apb-timer.c
@@ -13,7 +13,6 @@
#include <reset.h>
#include <timer.h>
#include <dm/device_compat.h>
-#include <linux/kconfig.h>
#include <asm/io.h>
#include <asm/arch/timer.h>
diff --git a/env/embedded.c b/env/embedded.c
index 7cbe54c..2959f8a 100644
--- a/env/embedded.c
+++ b/env/embedded.c
@@ -4,8 +4,6 @@
* Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
*/
-#include <linux/kconfig.h>
-
#ifndef __ASSEMBLY__
#define __ASSEMBLY__ /* Dirty trick to get only #defines */
#endif
diff --git a/include/bootstage.h b/include/bootstage.h
index 59a76d0..f4e77b0 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -12,7 +12,9 @@
#define _BOOTSTAGE_H
#include <linux/types.h>
+#ifdef USE_HOSTCC
#include <linux/kconfig.h>
+#endif
/* Flags for each bootstage record */
enum bootstage_flags {
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 4aa876a..81c76ef 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -9,8 +9,6 @@
#ifndef __AT91_SAMA5_COMMON_H
#define __AT91_SAMA5_COMMON_H
-#include <linux/kconfig.h>
-
/* ARM asynchronous clock */
#define CFG_SYS_AT91_SLOW_CLOCK 32768
#define CFG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
index 8c75a75..2da76f1 100644
--- a/include/configs/tqma6.h
+++ b/include/configs/tqma6.h
@@ -8,7 +8,6 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#include <linux/kconfig.h>
#include <linux/stringify.h>
/* place code in last 4 MiB of RAM */
diff --git a/include/env_internal.h b/include/env_internal.h
index 5c289d6..cbd1ef3 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -15,7 +15,6 @@
#ifndef _ENV_INTERNAL_H_
#define _ENV_INTERNAL_H_
-#include <linux/kconfig.h>
/**************************************************************************
*
diff --git a/include/u-boot/ecdsa.h b/include/u-boot/ecdsa.h
index 6e0269e..53490c6 100644
--- a/include/u-boot/ecdsa.h
+++ b/include/u-boot/ecdsa.h
@@ -8,7 +8,6 @@
#include <errno.h>
#include <image.h>
-#include <linux/kconfig.h>
/**
* crypto_algo API impementation for ECDSA;
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index 2f3b344..096e7f6 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -17,9 +17,9 @@
#else
#include "fdt_host.h"
#include "mkimage.h"
+#include <linux/kconfig.h>
#include <fdt_support.h>
#endif
-#include <linux/kconfig.h>
#include <u-boot/rsa-mod-exp.h>
#include <u-boot/rsa.h>
diff --git a/test/dm/scmi.c b/test/dm/scmi.c
index e80667e..adf36ff 100644
--- a/test/dm/scmi.c
+++ b/test/dm/scmi.c
@@ -23,7 +23,6 @@
#include <asm/scmi_test.h>
#include <dm/device-internal.h>
#include <dm/test.h>
-#include <linux/kconfig.h>
#include <power/regulator.h>
#include <test/ut.h>
diff --git a/tools/binman/test/blob_syms.c b/tools/binman/test/blob_syms.c
index 1df8d64..fc078da 100644
--- a/tools/binman/test/blob_syms.c
+++ b/tools/binman/test/blob_syms.c
@@ -5,7 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-#include <linux/kconfig.h>
#include <binman_sym.h>
DECLARE_BINMAN_MAGIC_SYM;
diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c
index 147c902..88ffda8 100644
--- a/tools/binman/test/u_boot_binman_syms.c
+++ b/tools/binman/test/u_boot_binman_syms.c
@@ -5,7 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-#include <linux/kconfig.h>
#include <binman_sym.h>
DECLARE_BINMAN_MAGIC_SYM;
diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c
index f686892..c4be54c 100644
--- a/tools/binman/test/u_boot_binman_syms_size.c
+++ b/tools/binman/test/u_boot_binman_syms_size.c
@@ -5,7 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-#include <linux/kconfig.h>
#include <binman_sym.h>
DECLARE_BINMAN_MAGIC_SYM;
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 550f310..f6f8109 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -12,8 +12,6 @@
#include <u-boot/crc.h>
#include <unistd.h>
-#include <linux/kconfig.h>
-
#ifndef __ASSEMBLY__
#define __ASSEMBLY__ /* Dirty trick to get only #defines */
#endif
diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
index b8fc606..6a261ff 100644
--- a/tools/mkeficapsule.c
+++ b/tools/mkeficapsule.c
@@ -16,7 +16,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <uuid/uuid.h>
-#include <linux/kconfig.h>
#include <gnutls/gnutls.h>
#include <gnutls/pkcs7.h>