[PATCH] net: dsa: mv88e6xxx: global2: Fix gcc compile error

From: Chen Wandun
Date: Thu Nov 07 2019 - 07:19:08 EST


In commit c5f299d59261 ("net: dsa: mv88e6xxx: global1_atu: Add helper for
get next"), it add a parameter in mv88e6xxx_g2_atu_stats_get only when
CONFIG_NET_DSA_MV88E6XXX_GLOBAL2 enabled, it also should make the same
change when CONFIG_NET_DSA_MV88E6XXX_GLOBAL2 disabled.

drivers/net/dsa/mv88e6xxx/chip.c: In function mv88e6xxx_devlink_atu_bin_get:
drivers/net/dsa/mv88e6xxx/chip.c:2752:8: error: too many arguments to function mv88e6xxx_g2_atu_stats_get
err = mv88e6xxx_g2_atu_stats_get(chip, &occupancy);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/dsa/mv88e6xxx/chip.c:36:0:
drivers/net/dsa/mv88e6xxx/global2.h:535:19: note: declared here
static inline int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip)
^~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [drivers/net/dsa/mv88e6xxx/chip.o] Error 1

Fixes: c5f299d59261 ("net: dsa: mv88e6xxx: global1_atu: Add helper for get next")
Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Chen Wandun <chenwandun@xxxxxxxxxx>
---
drivers/net/dsa/mv88e6xxx/global2.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/global2.h b/drivers/net/dsa/mv88e6xxx/global2.h
index d80ad20..1f42ee6 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.h
+++ b/drivers/net/dsa/mv88e6xxx/global2.h
@@ -532,7 +532,8 @@ static inline int mv88e6xxx_g2_atu_stats_set(struct mv88e6xxx_chip *chip,
return -EOPNOTSUPP;
}

-static inline int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip)
+static inline int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip,
+ u16 *stats)
{
return -EOPNOTSUPP;
}
--
2.7.4