Skip to contentSkip to conversation

net: dsa: ksz: Remove dead code and fix warnings

PATCH Applied Marek Vasut 2 participants 6 messages Aug 6, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 net: dsa: ksz: Remove dead code and fix warnings

Remove ksz_port_cleanup(), which is unused. Add missing include "ksz_common.h", which fixes the following warning when built with make ... W=1

drivers/net/dsa/microchip/ksz_common.c:23:6: warning: no previous prototype for ‘...’ [-Wmissing-prototypes]

Note that the order of the headers cannot be swapped, as that would trigger missing forward declaration errors, which would indicate the way forward is to merge the two headers into one.

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Tristram Ha <[email protected]>
Cc Vivien Didelot <[email protected]>
Cc Woojung Huh <[email protected]>
---
 drivers/net/dsa/microchip/ksz_common.c | 11 +----------
 drivers/net/dsa/microchip/ksz_common.h |  1 -
 2 files changed, 1 insertion(+), 11 deletions(-)
drivers/net/dsa/microchip/ksz_common.c +1 -10
index ce20cc90f9ef..a1e6e560fde8 100644
@@ -19,16 +19,7 @@
 #include <net/switchdev.h>
 
 #include "ksz_priv.h"
-
-void ksz_port_cleanup(struct ksz_device *dev, int port)
-{
-	/* Common code for port cleanup. */
-	mutex_lock(&dev->dev_mutex);
-	dev->on_ports &= ~(1 << port);
-	dev->live_ports &= ~(1 << port);
-	mutex_unlock(&dev->dev_mutex);
-}
-EXPORT_SYMBOL_GPL(ksz_port_cleanup);
+#include "ksz_common.h"
 
 void ksz_update_port_member(struct ksz_device *dev, int port)
 {
drivers/net/dsa/microchip/ksz_common.h +0 -1
index 84fed4a2578b..9f9ff0fb3b53 100644
@@ -9,7 +9,6 @@
 
 #include <linux/regmap.h>
 
-void ksz_port_cleanup(struct ksz_device *dev, int port);
 void ksz_update_port_member(struct ksz_device *dev, int port);
 void ksz_init_mib_timer(struct ksz_device *dev);
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/3 net: dsa: ksz: Merge ksz_priv.h into ksz_common.h

Merge the two headers into one, no functional change.

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Tristram Ha <[email protected]>
Cc Vivien Didelot <[email protected]>
Cc Woojung Huh <[email protected]>
---
 drivers/net/dsa/microchip/ksz8795.c     |   1 -
 drivers/net/dsa/microchip/ksz8795_spi.c |   1 -
 drivers/net/dsa/microchip/ksz9477.c     |   1 -
 drivers/net/dsa/microchip/ksz9477_spi.c |   1 -
 drivers/net/dsa/microchip/ksz_common.c  |   1 -
 drivers/net/dsa/microchip/ksz_common.h  | 144 ++++++++++++++++++++++
 drivers/net/dsa/microchip/ksz_priv.h    | 156 ------------------------
 7 files changed, 144 insertions(+), 161 deletions(-)
 delete mode 100644 drivers/net/dsa/microchip/ksz_priv.h
drivers/net/dsa/microchip/ksz8795.c +0 -1
index ae80b3c6dea2..a23d3ffdf0c4 100644
@@ -18,7 +18,6 @@
 #include <net/dsa.h>
 #include <net/switchdev.h>
 
-#include "ksz_priv.h"
 #include "ksz_common.h"
 #include "ksz8795_reg.h"
 
drivers/net/dsa/microchip/ksz8795_spi.c +0 -1
index 50aa0d24effb..d0f8153e86b7 100644
@@ -14,7 +14,6 @@
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
 
-#include "ksz_priv.h"
 #include "ksz_common.h"
 
 #define SPI_ADDR_SHIFT			12
drivers/net/dsa/microchip/ksz9477.c +0 -1
index a8c97f7a79b7..187be42de5f1 100644
@@ -14,7 +14,6 @@
 #include <net/dsa.h>
 #include <net/switchdev.h>
 
-#include "ksz_priv.h"
 #include "ksz9477_reg.h"
 #include "ksz_common.h"
 
drivers/net/dsa/microchip/ksz9477_spi.c +0 -1
index 5a9e27b337a8..a226b389e12d 100644
@@ -13,7 +13,6 @@
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
 
-#include "ksz_priv.h"
 #include "ksz_common.h"
 
 #define SPI_ADDR_SHIFT			24
drivers/net/dsa/microchip/ksz_common.c +0 -1
index a1e6e560fde8..b45c7b972cec 100644
@@ -18,7 +18,6 @@
 #include <net/dsa.h>
 #include <net/switchdev.h>
 
-#include "ksz_priv.h"
 #include "ksz_common.h"
 
 void ksz_update_port_member(struct ksz_device *dev, int port)
drivers/net/dsa/microchip/ksz_common.h +144 -0

151 lines not on this page · raw message

drivers/net/dsa/microchip/ksz_priv.h deleted +0 -156

156 lines not on this page · raw message

Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/3 net: dsa: ksz: Drop NET_DSA_TAG_KSZ9477

In reply to Marek Vasut

This Kconfig option is unused, drop it.

Cc Andrew Lunn <[email protected]>
Cc David S. Miller <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Tristram Ha <[email protected]>
Cc Vivien Didelot <[email protected]>
Cc Woojung Huh <[email protected]>
---
 drivers/net/dsa/microchip/Kconfig | 1 -
 net/dsa/Kconfig                   | 7 -------
 2 files changed, 8 deletions(-)
drivers/net/dsa/microchip/Kconfig +0 -1
index 5e4f74286ea3..e1c23d1e91e6 100644
@@ -5,7 +5,6 @@ config NET_DSA_MICROCHIP_KSZ_COMMON
 menuconfig NET_DSA_MICROCHIP_KSZ9477
 	tristate "Microchip KSZ9477 series switch support"
 	depends on NET_DSA
-	select NET_DSA_TAG_KSZ9477
 	select NET_DSA_MICROCHIP_KSZ_COMMON
 	help
 	  This driver adds support for Microchip KSZ9477 switch chips.
net/dsa/Kconfig +0 -7
index 6e942dda1bcd..2f69d4b53d46 100644
@@ -84,13 +84,6 @@ config NET_DSA_TAG_KSZ
 	  Say Y if you want to enable support for tagging frames for the
 	  Microchip 9893 family of switches.
 
-config NET_DSA_TAG_KSZ9477
-	tristate "Tag driver for Microchip 9477 family of switches"
-	select NET_DSA_TAG_KSZ_COMMON
-	help
-	  Say Y if you want to enable support for tagging frames for the
-	  Microchip 9477 family of switches.
-
 config NET_DSA_TAG_QCA
 	tristate "Tag driver for Qualcomm Atheros QCA8K switches"
 	help
Signature · 1 line
2.20.1
maintainer Applied
#5 lore raw
In reply to Marek Vasut

From: Marek Vasut <[email protected]>
Date: Tue, 6 Aug 2019 15:06:07 +0200

Quoted 11 lines

Remove ksz_port_cleanup(), which is unused. Add missing include "ksz_common.h", which fixes the following warning when built with make ... W=1

drivers/net/dsa/microchip/ksz_common.c:23:6: warning: no previous prototype for ‘...’ [-Wmissing-prototypes]

Note that the order of the headers cannot be swapped, as that would trigger missing forward declaration errors, which would indicate the way forward is to merge the two headers into one.

Applied.