All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: IS_ENABLED() and non-available symbols
Date: Sun, 14 Aug 2011 16:26:34 +0530	[thread overview]
Message-ID: <CAH+eYFD61keboBWfcnxEAwW-4PmoLpofZh08k606OkALg_VFuQ@mail.gmail.com> (raw)

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).

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;
 }

             reply	other threads:[~2011-08-14 10:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-14 10:56 Rabin Vincent [this message]
2011-08-14 16:55 ` IS_ENABLED() and non-available symbols Arnaud Lacombe
2011-08-14 17:02   ` Arnaud Lacombe
2011-08-15 10:55     ` Michal Marek
2011-08-15 14:52       ` Arnaud Lacombe
2011-08-15 19:04         ` Arnaud Lacombe

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=CAH+eYFD61keboBWfcnxEAwW-4PmoLpofZh08k606OkALg_VFuQ@mail.gmail.com \
    --to=rabin@rab.in \
    --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.