netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa/slave: Fix compilation warnings
@ 2012-10-29 16:57 Viresh Kumar
  2012-10-29 19:59 ` Ben Hutchings
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-29 16:57 UTC (permalink / raw)
  To: davem; +Cc: linaro-dev, patches, netdev, linux-kernel, Viresh Kumar

Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:

net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used [-Wunused-function]
net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used [-Wunused-function]
net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used [-Wunused-function]
net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined but not used [-Wunused-function]
net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but not used [-Wunused-function]
net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined but not used [-Wunused-function]
net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not used [-Wunused-function]

Fix them by enclosing these routines under #ifdef,endif.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 net/dsa/slave.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e32083d..5606fae 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -48,6 +48,8 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
 
 
 /* slave device handling ****************************************************/
+#if defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA) || \
+		defined(CONFIG_NET_DSA_TAG_TRAILER)
 static int dsa_slave_init(struct net_device *dev)
 {
 	struct dsa_slave_priv *p = netdev_priv(dev);
@@ -170,6 +172,8 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
 	return -EOPNOTSUPP;
 }
+#endif /* defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA ||
+		defined(CONFIG_NET_DSA_TAG_TRAILER) */
 
 
 /* ethtool operations *******************************************************/
-- 
1.7.12.rc2.18.g61b472e

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-11-07  3:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 16:57 [PATCH] net: dsa/slave: Fix compilation warnings Viresh Kumar
2012-10-29 19:59 ` Ben Hutchings
2012-10-30  6:45   ` Viresh Kumar
2012-10-30  7:31     ` Viresh Kumar
2012-10-30  7:53       ` Daniel Lezcano
2012-10-30  7:55         ` Viresh Kumar
2012-10-30  9:00           ` Daniel Lezcano
2012-10-30  9:03             ` Viresh Kumar
2012-10-30  9:26               ` Daniel Lezcano
2012-10-30  9:45                 ` Viresh Kumar
2012-10-30 10:04                   ` Daniel Lezcano
     [not found]       ` <CAKohponOKk5e2Sxyhjw-XvzVxF3tNp66rsnYCwvwHazAPAauKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-07  3:50         ` Viresh Kumar

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).