From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next] net: dsa: add CONFIG_NET_DSA_LEGACY
Date: Tue, 11 Apr 2017 23:20:26 +0200 [thread overview]
Message-ID: <20170411212026.GA7023@lunn.ch> (raw)
In-Reply-To: <20170411205237.29309-1-vivien.didelot@savoirfairelinux.com>
> +#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
next prev parent reply other threads:[~2017-04-11 21:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 20:52 [PATCH net-next] net: dsa: add CONFIG_NET_DSA_LEGACY Vivien Didelot
2017-04-11 20:59 ` Florian Fainelli
2017-04-12 14:22 ` Vivien Didelot
2017-04-11 21:20 ` Andrew Lunn [this message]
2017-04-12 14:50 ` Vivien Didelot
-- strict thread matches above, loose matches on Subject: below --
2016-07-20 22:26 Vivien Didelot
2016-07-21 0:35 ` Andrew Lunn
2016-07-21 2:15 ` Florian Fainelli
2016-07-21 14:46 ` Vivien Didelot
2016-07-21 14:52 ` Andrew Lunn
2016-07-21 14:44 ` Vivien Didelot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170411212026.GA7023@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).