net: dsa: ksz: Remove dead code and fix warnings
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.
--- 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
@@ -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
@@ -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
PATCH 2/3 net: dsa: ksz: Merge ksz_priv.h into ksz_common.h
Merge the two headers into one, no functional change.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Re: [PATCH 2/3] net: dsa: ksz: Merge ksz_priv.h into ksz_common.h
From: Marek Vasut <[email protected]>
Date: Tue, 6 Aug 2019 15:06:08 +0200
Quoted 3 lines
Merge the two headers into one, no functional change.
Signed-off-by Marek Vasut <[email protected]>
Applied.
PATCH 3/3 net: dsa: ksz: Drop NET_DSA_TAG_KSZ9477
In reply to Marek VasutThis Kconfig option is unused, drop it.
--- drivers/net/dsa/microchip/Kconfig | 1 - net/dsa/Kconfig | 7 ------- 2 files changed, 8 deletions(-)
drivers/net/dsa/microchip/Kconfig +0 -1
@@ -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
@@ -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
Re: [PATCH 3/3] net: dsa: ksz: Drop NET_DSA_TAG_KSZ9477
From: Marek Vasut <[email protected]>
Date: Tue, 6 Aug 2019 15:06:09 +0200
Quoted 3 lines
This
Kconfigoption is unused, drop it.Signed-off-by Marek Vasut <[email protected]>
Applied.
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.
Signed-off-by Marek Vasut <[email protected]>
Applied.