Thread (24 messages) flat view 24 messages, 3 authors, 2016-11-14

Re: [PATCH net-next 04/11] net: dsa: mv88e6xxx: Abstract stats_snapshot into ops structure

From: Vivien Didelot <hidden>
Date: 2016-11-13 23:37:45

Hi Andrew,

Andrew Lunn [off-list ref] writes:
+static int mv88e6320_stats_snapshot(struct mv88e6xxx_chip *chip, int port)
+{
+	port = (port + 1) << 5;
+
+	return _mv88e6xxx_stats_snapshot(chip, port);
+}
Please move the above helper in its internal SMI file (port, global1 or
whatever) and keep the below wrapper in chip.c. The correct prefix will
avoid having a _ prefix.
+static int mv88e6xxx_stats_snapshot(struct mv88e6xxx_chip *chip, int port)
+{
+	if (!chip->info->ops->stats_snapshot)
+		return -EOPNOTSUPP;
+
+	return chip->info->ops->stats_snapshot(chip, port);
+}
[...]
quoted hunk ↗ jump to hunk
 static const struct mv88e6xxx_ops mv88e6175_ops = {
@@ -3223,6 +3243,7 @@ static const struct mv88e6xxx_ops mv88e6175_ops = {
 	.port_set_duplex = mv88e6xxx_port_set_duplex,
 	.port_set_rgmii_delay = mv88e6352_port_set_rgmii_delay,
 	.port_set_speed = mv88e6185_port_set_speed,
+	.stats_snapshot = mv88e6xxx_stats_snapshot,
 };
Is this expected? Doesn't look correct to me to use
mv88e6xxx_stats_snapshot here.

Thanks,

        Vivien
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help