lkml.org 
[lkml]   [2012]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix
Date
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>
---
scripts/kconfig/lkc.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index c18f2bd..7aa9db0 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -39,6 +39,12 @@ extern "C" {
#ifndef CONFIG_
#define CONFIG_ "CONFIG_"
#endif
+static inline const char *CONFIG_prefix(void)
+{
+ return CONFIG_;
+}
+#undef CONFIG_
+#define CONFIG_ CONFIG_prefix()

#define TF_COMMAND 0x0001
#define TF_PARAM 0x0002
--
1.7.2.5


\
 
 \ /
  Last update: 2012-10-20 02:01    [W:0.048 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site