From patchwork Fri Oct 19 23:06:24 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: 1620321 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D103F3FC1A for ; Fri, 19 Oct 2012 23:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933135Ab2JSXHX (ORCPT ); Fri, 19 Oct 2012 19:07:23 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:45940 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757478Ab2JSXGi (ORCPT ); Fri, 19 Oct 2012 19:06:38 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so727862wgb.1 for ; Fri, 19 Oct 2012 16:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=AfYRFNmO31FSSgqQHKKGD7RuXk+ijY0DY49qWkMrtXs=; b=Z7sU2diryip65kzxhc8Hr0by43fqJvOpVrJrBi+FiyArcyblSmrnyxmEh1jFbyPEvj TVsAoF+bw5UwEEqN1GjflLvmm4cYs3suSOuoXnb0P7LIU9M4Eg7qcIskN7x+5U72jVUO 4/KCwBLk/rv+ca0Sf/JOYmCRybbbRxiTzfzPu28ALN+//2fXbQetw2dGWj71jqP2d1vh wZZRQgDtD51uRgYD2uOMi0GkNo7VC1frKlbS9mtm8SI6vTgOaKA17prLS+IvJPkrRKrS B6yAmxXP3R/WBrsMfYstR74z+SWlK8ykWVbhKRUYs48AncZLmZJToE5nvVMHvAisgOW1 fOCw== Received: by 10.180.87.132 with SMTP id ay4mr6122424wib.5.1350687997061; Fri, 19 Oct 2012 16:06:37 -0700 (PDT) Received: from localhost.localdomain (ARennes-256-1-43-34.w90-32.abo.wanadoo.fr. [90.32.26.34]) by mx.google.com with ESMTPS id fp6sm17125857wib.0.2012.10.19.16.06.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 16:06:36 -0700 (PDT) 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: Sat, 20 Oct 2012 01:06:24 +0200 Message-Id: <1350687985-21053-3-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr> References: <1350687985-21053-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). 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" --- 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