From: Grant Likely <grant.likely@secretlab.ca>
To: Linus Walleij <linus.walleij@linaro.org>,
Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-kernel@vger.kernel.org, linus.walleij@stericsson.com,
patches@linaro.org
Subject: Re: [PATCH] gpio/exynos: Fix compiler warnings when non-exynos machines are selected
Date: Fri, 11 May 2012 18:29:12 -0600 [thread overview]
Message-ID: <20120512002912.8A0A23E0791@localhost> (raw)
In-Reply-To: <CACRpkdYHKR+oOD36RCUMobEwJj_Y9WDHTUY+UaHAx0YegMhXyg@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
On Wed, 2 May 2012 01:26:12 +0200, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Apr 30, 2012 at 8:52 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>
> > +#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
> > +#endif
> > -static struct samsung_gpio_chip exynos4_gpios_1[] = {
> > #ifdef CONFIG_ARCH_EXYNOS4
> > +static struct samsung_gpio_chip exynos4_gpios_1[] = {
> > -#endif
> > +#endif
> > -static struct samsung_gpio_chip exynos4_gpios_2[] = {
> > #ifdef CONFIG_ARCH_EXYNOS4
> > +static struct samsung_gpio_chip exynos4_gpios_2[] = {
> > -#endif
> > +#endif
> > -static struct samsung_gpio_chip exynos4_gpios_3[] = {
> > #ifdef CONFIG_ARCH_EXYNOS4
> > +static struct samsung_gpio_chip exynos4_gpios_3[] = {
> > -#endif
> > +#endif
> > #ifdef CONFIG_ARCH_EXYNOS5
> > +#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
> > +#endif
> > +#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
> > +#endif
>
> We really want to get rid of this kind of stuff from all drivers, #ifdefs are
> declared ugly already in Documentation/CodingStyle.
>
> Any chance you could solve this problem by reworking the driver to
> pass some flag in platform data tell which exynos it's for
> and jist adapt at runtime instead of the compile-time quirkiness?
>
> Besides looking better, it helps us to get to a single zImage for the
> exynoses too..
I don't see any single-zImage issues here. There are no #else clauses
in the #ifdef blocks so all it does it compile out unused code when
exynos4 & 5 is not enabled. I'm going to apply it.
g.
next prev parent reply other threads:[~2012-05-12 0:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 6:52 [PATCH] gpio/exynos: Fix compiler warnings when non-exynos machines are selected Sachin Kamat
2012-05-01 23:26 ` Linus Walleij
2012-05-02 4:00 ` Sachin Kamat
2012-05-12 0:29 ` Grant Likely [this message]
2012-05-15 12:08 ` Arnd Bergmann
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=20120512002912.8A0A23E0791@localhost \
--to=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.org \
/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).