lkml.org 
[lkml]   [2021]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] of: property: fw_devlink: Ignore interrupts property for some configs
On Tue, Feb 16, 2021 at 12:20 PM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
>
> On 15.02.21 23:42, Saravana Kannan wrote:
>
> Hi,
>
> > diff --git a/drivers/of/property.c b/drivers/of/property.c
> > index 79b68519fe30..5036a362f52e 100644
> > --- a/drivers/of/property.c
> > +++ b/drivers/of/property.c
> > @@ -1300,6 +1300,9 @@ static struct device_node *parse_interrupts(struct device_node *np,
> > {
> > struct of_phandle_args sup_args;
> >
> > + if (!IS_ENABLED(CONFIG_OF_IRQ) || IS_ENABLED(CONFIG_PPC))
> > + return NULL;
> > +
> > if (strcmp(prop_name, "interrupts") &&
> > strcmp(prop_name, "interrupts-extended"))
> > return NULL;
>
> wouldn't it be better to #ifdef-out the whole code in this case ?

No, #ifdef is not preferred. That's why we even have the IS_ENABLED()
macros in the first place. The compiled will optimize out the code.

-Saravana

\
 
 \ /
  Last update: 2021-02-17 11:38    [W:0.234 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site