From: Pavel Machek <pavel@ucw.cz>
To: Grant Likely <grant.likely@linaro.org>
Cc: linux-input@vger.kernel.org,
'Beno?t Cousson' <bcousson@baylibre.com>,
Tony Lindgren <tony@atomide.com>,
Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Rob Landley <rob@landley.net>,
Russell King <linux@arm.linux.org.uk>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: Re: [PATCHv2 1/3] Input: twl4030-keypad - add device tree support
Date: Wed, 30 Oct 2013 14:59:02 +0100 [thread overview]
Message-ID: <20131030135902.GA2656@amd.pavel.ucw.cz> (raw)
In-Reply-To: <20131030135307.D8CE1C402A0@trevor.secretlab.ca>
On Wed 2013-10-30 06:53:07, Grant Likely wrote:
> On Sun, 27 Oct 2013 12:47:53 +0100, Pavel Machek <pavel@ucw.cz> wrote:
> > > > > +#if IS_ENABLED(CONFIG_OF)
> > > > I'm probably missing something here, but why not #ifdef CONFIG_OF?
> > >
> > > I have been told for other drivers, that IS_ENABLED() is
> > > the prefered way to check for configuration these days.
> >
> > CONFIG_OF can not be module, using IS_ENABLED() on it is just wrong.
>
> That makes no sense. There is absolutely nothing wrong with using
> IS_ENABLED() for CONFIG_OF.
Besides being too long, confusing for a reader, and testing for an
option that can't exist?
include/linux/kconfig.h-/*
include/linux/kconfig.h: * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
include/linux/kconfig.h- * 0 otherwise.
include/linux/kconfig.h- *
include/linux/kconfig.h- */
include/linux/kconfig.h:#define IS_ENABLED(option) \
include/linux/kconfig.h- (config_enabled(option) || config_enabled(option##_MODULE))
include/linux/kconfig.h-
include/linux/kconfig.h-/*
include/linux/kconfig.h- * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
include/linux/kconfig.h- * otherwise. For boolean options, this is
equivalent to
include/linux/kconfig.h: * IS_ENABLED(CONFIG_FOO).
include/linux/kconfig.h- */
include/linux/kconfig.h-#define IS_BUILTIN(option) config_enabled(option)
include/linux/kconfig.h-
Oops. And I made a mistake of looking up config_enabled(). Obfuscated
C code contest.
Just use #ifdef CONFIG_foo.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2013-10-30 13:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 12:47 [PATCHv2 0/3] Add Nokia N900 DT support Sebastian Reichel
2013-10-22 12:47 ` [PATCHv2 1/3] Input: twl4030-keypad - add device tree support Sebastian Reichel
2013-10-27 11:17 ` Pavel Machek
2013-10-27 11:40 ` Sebastian Reichel
[not found] ` <20131027114026.GB14091-SfvFxonMDyemK9LvCR3Hrw@public.gmane.org>
2013-10-27 11:47 ` Pavel Machek
2013-10-27 12:23 ` Tony Lindgren
2013-10-27 16:31 ` Sebastian Reichel
2013-10-30 13:53 ` Grant Likely
2013-10-30 13:59 ` Pavel Machek [this message]
2013-10-28 6:42 ` Kumar Gala
2013-10-29 1:06 ` Sebastian Reichel
2013-10-29 8:33 ` Kumar Gala
2013-10-29 10:25 ` Sebastian Reichel
2013-10-22 12:47 ` [PATCHv2 2/3] DTS: ARM: TWL4030: Add keypad node Sebastian Reichel
2013-10-22 12:47 ` [PATCHv2 3/3] ARM: dts: N900: TWL4030 Keypad Matrix definition Sebastian Reichel
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=20131030135902.GA2656@amd.pavel.ucw.cz \
--to=pavel@ucw.cz \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=swarren@wwwdotorg.org \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).