linux-mips
[Top] [All Lists]

Re: [PATCH V4 1/2] bcma: gpio: add own IRQ domain

To: Hauke Mehrtens <hauke@hauke-m.de>, John Crispin <john@phrozen.org>, Rafał Miłecki <zajec5@gmail.com>
Subject: Re: [PATCH V4 1/2] bcma: gpio: add own IRQ domain
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 08 Dec 2013 22:24:02 +0300
Cc: linux-mips@linux-mips.org
In-reply-to: <52A4B609.20805@hauke-m.de>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Organization: Cogent Embedded
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1385747290-22575-1-git-send-email-zajec5@gmail.com> <1385752379-19540-1-git-send-email-zajec5@gmail.com> <5298FAED.7020408@phrozen.org> <CACna6rwb4fcfEE8AtwHUWfyeT00jh4ug-WfQyarkbiQr1jdGkg@mail.gmail.com> <52990421.3000002@phrozen.org> <52A4B609.20805@hauke-m.de>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
Hello.

On 12/08/2013 09:10 PM, Hauke Mehrtens wrote:

+#ifdef CONFIG_BCMA_HOST_SOC
          chip->to_irq            = bcma_gpio_to_irq;
+#endif
          chip->ngpio             = 16;

Hi,

Should this not be

if (IS_ENABLED(CONFIG_BCMA_HOST_SOC))
          chip->to_irq = bcma_gpio_to_irq;

I can't find a proper documentation about that. It's definitely nicer
to use
#if IS_ENABLED(FOO)
instead of
#if defined(FOO) || defined(FOO_MODULE)

But are we supposed to use it also for a simple
#if defined(FOO)
?

I tried to Google about this but found only some minor flame-wars ;)

Is that documented anywhere?


The commit message has the relevant info ...

http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=2a11c8ea20bf850b3a2c60db8c2e7497d28aba99

I read this and as far as I understand that when CONFIG_BCMA_HOST_SOC is
bool and not tristate "#ifdef CONFIG_BCMA_HOST_SOC" and  "#if
IS_ENABLED(CONFIG_BCMA_HOST_SOC)" will have the same effect?

You can also use IS_BUILTIN(CONFIG_BCMA_HOST_SOC) to avoid unneeded test for the modular case.

Hauke

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>