Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754362AbdDLOvv (ORCPT ); Wed, 12 Apr 2017 10:51:51 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:52880 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbdDLOvr (ORCPT ); Wed, 12 Apr 2017 10:51:47 -0400 From: Vivien Didelot To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH net-next] net: dsa: add CONFIG_NET_DSA_LEGACY In-Reply-To: <20170411212026.GA7023@lunn.ch> References: <20170411205237.29309-1-vivien.didelot@savoirfairelinux.com> <20170411212026.GA7023@lunn.ch> Date: Wed, 12 Apr 2017 10:50:17 -0400 Message-ID: <87shldznme.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 701 Lines: 27 Hi Andrew, Andrew Lunn 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