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

From: Andrew Lunn
Date: Tue Apr 11 2017 - 17:20:38 EST


> +#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 */

Hi Vivien

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.

Andrew