All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>,
	linux-kernel@vger.kernel.org,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix
Date: Sat, 20 Oct 2012 01:06:24 +0200	[thread overview]
Message-ID: <1350687985-21053-3-git-send-email-yann.morin.1998@free.fr> (raw)
In-Reply-To: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr>

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


  parent reply	other threads:[~2012-10-19 23:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 23:06 [PATCH 0/3 v3] kconfig: get the CONFIG_ prefix from the environment Yann E. MORIN
2012-10-19 23:06 ` [PATCH 1/3] kconfig: remove CONFIG_ from string constants Yann E. MORIN
2012-10-19 23:06 ` Yann E. MORIN [this message]
2012-10-19 23:06 ` [PATCH 3/3] kconfig: get CONFIG_ prefix from the environment Yann E. MORIN
2012-10-30 22:36 ` [PATCH 0/3 v3] kconfig: get the " Yann E. MORIN
2012-11-20 10:22   ` Michal Marek
2012-11-22  0:08     ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2012-10-18 19:50 [PATCH 0/3 v2] " Yann E. MORIN
2012-10-18 19:50 ` [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix Yann E. MORIN
2012-10-19 17:01   ` Michal Marek
2012-10-19 17:59     ` Yann E. MORIN
2012-10-09 22:46 [PATH 0/3] kcofnig: get the CONFIG_ prefix from the environment Yann E. MORIN
2012-10-09 22:46 ` [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350687985-21053-3-git-send-email-yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.