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>
This commit is contained in:
Tom Rini
2023-12-14 07:16:54 -05:00
parent 36d3db6c2c
commit b106961c2e
17 changed files with 7 additions and 16 deletions

2
env/embedded.c vendored
View File

@@ -4,7 +4,9 @@
* Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
*/
#ifdef USE_HOSTCC
#include <linux/kconfig.h>
#endif
#ifndef __ASSEMBLY__
#define __ASSEMBLY__ /* Dirty trick to get only #defines */