]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dsa: tag_brcm: Avoid unused symbols
authorAndrew Lunn <andrew@lunn.ch>
Sun, 28 Apr 2019 17:37:22 +0000 (19:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Apr 2019 23:41:01 +0000 (19:41 -0400)
It is possible that the driver is compiled with both
CONFIG_NET_DSA_TAG_BRCM and CONFIG_NET_DSA_TAG_BRCM_PREPEND disabled.
This results in warnings about unused symbols. Add some conditional
compilation to avoid this.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
v2
Reorder patch to before tag drivers can be modules

Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/tag_brcm.c

index 9890097a85d94a9d4b416de8c35971daa196d57c..d52db5f2c72171cdc8f5a1b389642362170a4913 100644 (file)
@@ -55,6 +55,9 @@
 #define BRCM_EG_TC_MASK                0x7
 #define BRCM_EG_PID_MASK       0x1f
 
+#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM) || \
+       IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM_PREPEND)
+
 static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb,
                                        struct net_device *dev,
                                        unsigned int offset)
@@ -139,8 +142,9 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
 
        return skb;
 }
+#endif
 
-#ifdef CONFIG_NET_DSA_TAG_BRCM
+#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM)
 static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb,
                                     struct net_device *dev)
 {
@@ -179,7 +183,7 @@ DSA_TAG_DRIVER(brcm_netdev_ops);
 MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM);
 #endif
 
-#ifdef CONFIG_NET_DSA_TAG_BRCM_PREPEND
+#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM_PREPEND)
 static struct sk_buff *brcm_tag_xmit_prepend(struct sk_buff *skb,
                                             struct net_device *dev)
 {