SUPERH platform development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
Date: Mon, 17 Jun 2013 19:19:07 +0000	[thread overview]
Message-ID: <51BF612B.6030900@cogentembedded.com> (raw)
In-Reply-To: <1371496527-13149-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hello.

On 06/17/2013 11:15 PM, Laurent Pinchart wrote:

> All functions and data types used by OF-specific code paths are declared
> in <linux/of.h> regardless of CONFIG_OF. Replace the #ifdef CONFIG_OF
> guard with a if(IS_SELECTED(CONFIG_OF)) and let the compiler optimize

    You're using IS_ENABLED() actually.

> the unused code away.

> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   drivers/gpio/gpio-rcar.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)

> diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
> index 5a693dd..7fd09ef 100644
> --- a/drivers/gpio/gpio-rcar.c
> +++ b/drivers/gpio/gpio-rcar.c
> @@ -279,16 +279,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
>   static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
>   {
>   	struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
> -#ifdef CONFIG_OF
>   	struct device_node *np = p->pdev->dev.of_node;
>   	struct of_phandle_args args;
>   	int ret;
> -#endif
>
> -	if (pdata)
> +	if (pdata) {
>   		p->config = *pdata;
> -#ifdef CONFIG_OF
> -	else if (np) {
> +	} else if (IS_ENABLED(CONFIG_OF) && np) {
>   		ret = of_parse_phandle_with_args(np, "gpio-ranges",
>   				"#gpio-range-cells", 0, &args);
>   		p->config.number_of_pins = ret = 0 && args.args_count = 3

WBR, Sergei



  reply	other threads:[~2013-06-17 19:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 19:15 [PATCH 0/2] R-Car GPIO fixes Laurent Pinchart
2013-06-17 19:15 ` [PATCH 1/2] gpio-rcar: Reference core gpio documentation in the DT bindings Laurent Pinchart
2013-06-19 19:16   ` Linus Walleij
2013-06-17 19:15 ` [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections Laurent Pinchart
2013-06-17 19:19   ` Sergei Shtylyov [this message]
2013-06-17 19:21     ` Laurent Pinchart
2013-06-18  8:02       ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2013-06-20 13:09 [GIT PULL 0/2] Renesas ARM based SoC GPIO R-Car updates for v3.11 #2 Simon Horman
2013-06-20 13:09 ` [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections Simon Horman

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=51BF612B.6030900@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-arm-kernel@lists.infradead.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