From patchwork Sun Aug 14 10:56:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 1064322 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7EAvLsl029570 for ; Sun, 14 Aug 2011 10:57:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127Ab1HNK5S (ORCPT ); Sun, 14 Aug 2011 06:57:18 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:48929 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047Ab1HNK5S (ORCPT ); Sun, 14 Aug 2011 06:57:18 -0400 Received: by bke11 with SMTP id 11so2476025bke.19 for ; Sun, 14 Aug 2011 03:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=pNgthySJR3R7oVUR1bpdUCFvOoFl61ywnk2g/ZiuI0A=; b=oE9gnRiqaf1uibdgkBgyhF4GdT2CiZhH3+21Zp7d5GQWWxjIvIBvSXy/Tw36I93H1C m2ut60/ix5uWGWjAbc/NIUKMXm73vDGYF1g48EM/x1LnJqGLkj2OGQic+PVZ+XB4oS9D J6pAJvLYeYHv/yV8pzG29+Ss5uvN32qIcegLA= Received: by 10.205.34.193 with SMTP id st1mr556305bkb.74.1313319436447; Sun, 14 Aug 2011 03:57:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.57.208 with HTTP; Sun, 14 Aug 2011 03:56:34 -0700 (PDT) From: Rabin Vincent Date: Sun, 14 Aug 2011 16:26:34 +0530 X-Google-Sender-Auth: ZULRT7B9Rz5rio6K1BA9yAk50ZA Message-ID: Subject: IS_ENABLED() and non-available symbols To: Michal Marek Cc: linux-kbuild@vger.kernel.org, LKML Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 14 Aug 2011 10:57:21 +0000 (UTC) I'm trying to use the new IS_ENABLED() stuff, but it appears that it only works if the symbol being tested has its dependencies met, and results in compiler errors if that is not the case. For example, I've added code using IS_ENABLED(CONFIG_THUMB2_KERNEL) as in the below patch. My config is arch/arm/configs/omap2plus_defconfig which doesn't satisfy the dependencies for CONFIG_THUMB2_KERNEL (defined in arch/arm/Kconfig). Compiling results in the following errors (and indeed the macro hasn't been generated in include/generated/autoconfg.h). If I modify my config to satisfy the dependencies for CONFIG_THUMB2_KERNEL so that it is selectable, the __enabled_CONFIG_THUMB2_KERNEL macro gets generated. arch/arm/kernel/setup.c: In function 'c_show': arch/arm/kernel/setup.c:1056: error: '__enabled_CONFIG_THUMB2_KERNEL' undeclared (first use in this function) arch/arm/kernel/setup.c:1056: error: (Each undeclared identifier is reported only once arch/arm/kernel/setup.c:1056: error: for each function it appears in.) arch/arm/kernel/setup.c:1056: error: '__enabled_CONFIG_THUMB2_KERNEL_MODULE' undeclared (first use in this function) Kernel is latest linus (v3.1-rc1-272-g73e0881). the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 70bca64..59aa480 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1053,6 +1053,9 @@ static int c_show(struct seq_file *m, void *v) seq_printf(m, "Serial\t\t: %08x%08x\n", system_serial_high, system_serial_low); + if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) + printk("Thumb-2\n"); + return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in