Re: [PATCH net-next] net: dsa: add CONFIG_NET_DSA_LEGACY

From: Vivien Didelot
Date: Wed Apr 12 2017 - 10:51:59 EST


Hi Andrew,

Andrew Lunn <andrew@xxxxxxx> 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