global: Restrict use of '#include <linux/kconfig.h>'
Subsystems (5)
PATCH 1/1 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.
---
Cc: Simon Glass <[email protected]>
--- arch/arm/include/asm/arch-fsl-layerscape/config.h | 1 - arch/arm/mach-rockchip/tpl.c | 1 - arch/arm/mach-sunxi/dram_sun50i_h6.c | 1 - arch/arm/mach-sunxi/dram_sun50i_h616.c | 1 - arch/arm/mach-sunxi/dram_sunxi_dw.c | 1 - boot/image-fit.c | 2 +- boot/image.c | 2 +- drivers/timer/dw-apb-timer.c | 1 - env/embedded.c | 2 ++ include/bootstage.h | 2 ++ include/configs/at91-sama5_common.h | 2 -- include/configs/tqma6.h | 1 - include/env_internal.h | 1 - include/u-boot/ecdsa.h | 1 - lib/rsa/rsa-verify.c | 2 +- test/dm/scmi.c | 1 - tools/mkeficapsule.c | 1 - 17 files changed, 7 insertions(+), 16 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/config.h +0 -1
@@ -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__
arch/arm/mach-rockchip/tpl.c +0 -1
@@ -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>
arch/arm/mach-sunxi/dram_sun50i_h6.c +0 -1
@@ -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:
arch/arm/mach-sunxi/dram_sun50i_h616.c +0 -1
@@ -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 ,
arch/arm/mach-sunxi/dram_sunxi_dw.c +0 -1
@@ -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) {
boot/image-fit.c +1 -1
@@ -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>
boot/image.c +1 -1
@@ -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>
drivers/timer/dw-apb-timer.c +0 -1
@@ -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>
env/embedded.c +2 -0
@@ -4,7 +4,9 @@* Erik Theisen, Wave 7 Optics, [email protected]. */ +#ifdef USE_HOSTCC #include <linux/kconfig.h> +#endif #ifndef __ASSEMBLY__#define __ASSEMBLY__/* Dirty trick to get only #defines */
include/bootstage.h +2 -0
@@ -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 {
include/configs/at91-sama5_common.h +0 -2
@@ -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 */
include/configs/tqma6.h +0 -1
@@ -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 */
include/env_internal.h +0 -1
@@ -15,7 +15,6 @@#ifndef _ENV_INTERNAL_H_#define _ENV_INTERNAL_H_ -#include <linux/kconfig.h> /************************************************************************** *
include/u-boot/ecdsa.h +0 -1
@@ -8,7 +8,6 @@#include <errno.h> #include <image.h> -#include <linux/kconfig.h> /** * crypto_algo API impementation for ECDSA;
lib/rsa/rsa-verify.c +1 -1
@@ -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>
test/dm/scmi.c +0 -1
@@ -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>
tools/mkeficapsule.c +0 -1
@@ -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>
Signature · 1 line
2.34.1
Quoted 22 lines · Tom Rini
In general terms, we -include
include/linux/kconfig.hand 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 asCONFIG_IS_ENABLED()can be evaluated. In this case make sure that we guard these includes with a test forUSE_HOSTCCso that it clear as to why we're doing this.Signed-off-by Tom Rini <[email protected]>---
Cc: Simon Glass <[email protected]>--- arch/arm/include/asm/arch-fsl-layerscape/config.h | 1 - arch/arm/mach-rockchip/tpl.c | 1 - arch/arm/mach-sunxi/dram_sun50i_h6.c | 1 - arch/arm/mach-sunxi/dram_sun50i_h616.c | 1 - arch/arm/mach-sunxi/dram_sunxi_dw.c | 1 - boot/image-fit.c | 2 +- boot/image.c | 2 +- drivers/timer/dw-apb-timer.c | 1 - env/embedded.c | 2 ++ include/bootstage.h | 2 ++
Quoted 9 lines
include/configs/at91-sama5_common.h | 2 -- include/configs/tqma6.h | 1 - include/env_internal.h | 1 - include/u-boot/ecdsa.h | 1 - lib/rsa/rsa-verify.c | 2 +- test/dm/scmi.c | 1 - tools/mkeficapsule.c | 1 - 17 files changed, 7 insertions(+), 16 deletions(-)
Quoted 8 lines · Tom Rini
In general terms, we -include
include/linux/kconfig.hand 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 asCONFIG_IS_ENABLED()can be evaluated. In this case make sure that we guard these includes with a test forUSE_HOSTCCso that it clear as to why we're doing this.[...]
Applied to u-boot/next, thanks!
Signature · 1 line
Tom