* [PATCH] net: dsa: mv88e6xxx: fix unused function warning
@ 2019-03-04 20:36 Arnd Bergmann
2019-03-04 20:42 ` Heiner Kallweit
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-03-04 20:36 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller
Cc: Arnd Bergmann, Marek Behún, Russell King,
Uwe Kleine-König, netdev, linux-kernel
The newly introduced function is only used inside of an #ifdef
and causes a warning when that is disabled:
drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]
Move it into the same #ifdef block to shut up the warning.
Fixes: ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/dsa/mv88e6xxx/chip.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index e4ad16b2dc38..168d4898c36f 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4620,14 +4620,6 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
return 0;
}
-static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
-{
- int i;
-
- for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
- chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
-}
-
static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
int port)
{
@@ -4637,6 +4629,14 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
}
#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
+static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
+{
+ int i;
+
+ for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
+ chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
+}
+
static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
struct device *host_dev, int sw_addr,
void **priv)
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: fix unused function warning
2019-03-04 20:36 [PATCH] net: dsa: mv88e6xxx: fix unused function warning Arnd Bergmann
@ 2019-03-04 20:42 ` Heiner Kallweit
2019-03-04 21:08 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2019-03-04 20:42 UTC (permalink / raw)
To: Arnd Bergmann, Andrew Lunn, Vivien Didelot, Florian Fainelli,
David S. Miller
Cc: Marek Behún, Russell King, Uwe Kleine-König, netdev,
linux-kernel
On 04.03.2019 21:36, Arnd Bergmann wrote:
> The newly introduced function is only used inside of an #ifdef
> and causes a warning when that is disabled:
>
> drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]
>
> Move it into the same #ifdef block to shut up the warning.
>
> Fixes: ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
A fix has been submitted already. See discussion here:
https://marc.info/?t=155170356600004&r=1&w=2
and the fix here:
https://patchwork.ozlabs.org/patch/1051275/
Heiner
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: fix unused function warning
2019-03-04 20:42 ` Heiner Kallweit
@ 2019-03-04 21:08 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-03-04 21:08 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
Marek Behún, Russell King, Uwe Kleine-König,
Networking, Linux Kernel Mailing List
On Mon, Mar 4, 2019 at 9:42 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> On 04.03.2019 21:36, Arnd Bergmann wrote:
> > The newly introduced function is only used inside of an #ifdef
> > and causes a warning when that is disabled:
> >
> > drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]
> >
> > Move it into the same #ifdef block to shut up the warning.
> >
> > Fixes: ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> A fix has been submitted already. See discussion here:
> https://marc.info/?t=155170356600004&r=1&w=2
> and the fix here:
> https://patchwork.ozlabs.org/patch/1051275/
Ok, that looks good, thanks for the reply!
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-04 21:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 20:36 [PATCH] net: dsa: mv88e6xxx: fix unused function warning Arnd Bergmann
2019-03-04 20:42 ` Heiner Kallweit
2019-03-04 21:08 ` Arnd Bergmann
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).