lkml.org 
[lkml]   [2017]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net-next] net: dsa: add CONFIG_NET_DSA_LEGACY
Date
Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

>> +#ifdef CONFIG_NET_DSA_LEGACY
>> static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
>> struct device *host_dev, int sw_addr,
>> void **priv)
>> @@ -4256,6 +4257,7 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
>>
>> return NULL;
>> }
>> +#endif /* CONFIG_NET_DSA_LEGACY */
>
> Rather than scatter #ifdef everywhere, can you use
>
> if (!IS_ENABLED(CONFIG_NET_DSA_LEGACY))
> return NULL
>
> The compiler will then throw away the rest of the function, after
> checking it does actually compile.

I'll make the legacy code compile anyway then.

Thanks!

Vivien

\
 
 \ /
  Last update: 2017-04-12 16:52    [W:0.053 / U:4.888 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site