
On Fri, 12 Jun 2020 at 05:02, Rasmus Villemoes rasmus.villemoes@prevas.dk wrote:
Instead of using the arg1_or_junk trick to pick between two choices, with a bit of duplication between the branches (and most of the CONFIG_TPL_BUILD case being redundant, as _IS_TPL is known to be defined to 1 in that case), simply define a prefix that we inject between CONFIG_ and the given config symbol.
This only requires one level of indirection (to get the _CONFIG_PREFIX macro expanded before the token concatenation takes place), and makes it easy to, say, introduce a CONFIG_HOSTTOOL_ prefix. [I would expect most HOSTTOOL_ symbols to just be def_bool y, but it would allow us to clean up some of the ifdef HOSTCC mess in the sources shared between U-Boot and host tools.]
Signed-off-by: Rasmus Villemoes rasmus.villemoes@prevas.dk
include/linux/kconfig.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org