OSDN Git Service

net: dsa: ksz: Remove dead code and fix warnings
authorMarek Vasut <marex@denx.de>
Tue, 6 Aug 2019 13:06:07 +0000 (15:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Aug 2019 18:59:17 +0000 (11:59 -0700)
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 <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h

index ce20cc9..a1e6e56 100644 (file)
 #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)
 {
index 84fed4a..9f9ff0f 100644 (file)
@@ -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);