From patchwork Thu Oct 18 19:50:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1612861 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E6F90DFB34 for ; Thu, 18 Oct 2012 19:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754015Ab2JRTuW (ORCPT ); Thu, 18 Oct 2012 15:50:22 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:41851 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754023Ab2JRTuV (ORCPT ); Thu, 18 Oct 2012 15:50:21 -0400 Received: from treguer.bzh.lan ([90.32.26.34]) by mwinf5d49 with ME id CjqJ1k00E0k8n6203jqLcv; Thu, 18 Oct 2012 21:50:20 +0200 From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , linux-kernel@vger.kernel.org, "Yann E. MORIN" Subject: [PATCH 2/3] kconfig: add a function to get the CONFIG_ prefix Date: Thu, 18 Oct 2012 21:50:15 +0200 Message-Id: <1350589816-20447-3-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1350589816-20447-1-git-send-email-yann.morin.1998@free.fr> References: <1350589816-20447-1-git-send-email-yann.morin.1998@free.fr> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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). Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/lkc.h | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index c18f2bd..25862fd 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -36,9 +36,17 @@ extern "C" { #define _(text) gettext(text) #define N_(text) (text) -#ifndef CONFIG_ -#define CONFIG_ "CONFIG_" +/* Those two defines copied from include/linux/stringify.h */ +#define __stringify_1(x...) #x +#define __stringify(x...) __stringify_1(x) +static inline const char *CONFIG_prefix(void) +{ + return __stringify(CONFIG_); +} +#ifdef CONFIG_ +#undef CONFIG_ #endif +#define CONFIG_ CONFIG_prefix() #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002