Skip to content

Commit b341f78

Browse files
yann-morin-1998michal42
authored andcommitted
kconfig: add a function to get the CONFIG_ prefix
Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means the CONFIG_ prefix is hard-coded at compile time. This goes against having a run-time defined CONFIG_ prefix. Add a function that returns the CONFIG_ prefix to use (but keep the current hard-coded behavior, to be changed in a later patch). To avoid touching all the code that uses the CONFIG_ macro, we just undef it, and define it to be a call to the function. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 337a275 commit b341f78

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎scripts/kconfig/lkc.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ extern "C" {
3939
#ifndef CONFIG_
4040
#define CONFIG_ "CONFIG_"
4141
#endif
42+
static inline const char *CONFIG_prefix(void)
43+
{
44+
return CONFIG_;
45+
}
46+
#undef CONFIG_
47+
#define CONFIG_ CONFIG_prefix()
4248

4349
#define TF_COMMAND 0x0001
4450
#define TF_PARAM 0x0002

0 commit comments

Comments
 (0)