public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
Date: Mon, 17 Jun 2013 21:21:08 +0200	[thread overview]
Message-ID: <2696904.tcjoE5nNPq@avalon> (raw)
In-Reply-To: <51BF612B.6030900@cogentembedded.com>

On Monday 17 June 2013 23:19:07 Sergei Shtylyov wrote:
> 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.

Oops. We should fix gcc to check the commit messages :-)

Simon, could you fix this while applying, or should I resubmit ?

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

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2013-06-17 19:21 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
2013-06-17 19:21     ` Laurent Pinchart [this message]
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=2696904.tcjoE5nNPq@avalon \
    --to=laurent.pinchart@ideasonboard.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