Thread (14 messages) flat view 14 messages, 3 authors, 2016-06-07

Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

From: Andrew Lunn <andrew@lunn.ch>
Date: 2016-06-07 22:24:14

On Tue, Jun 07, 2016 at 03:13:35PM -0700, Florian Fainelli wrote:
On 06/07/2016 02:51 PM, Andrew Lunn wrote:
quoted
quoted
+int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst,
+			       struct dsa_switch *ds)
+{
+	struct net_device *master;
+	struct ethtool_ops *cpu_ops;
+
+	master = ds->dst->master_netdev;
You pass in dst as a parameter, and then don't use it!
I do use it here:

        memcpy(&dst->master_ethtool_ops, master->ethtool_ops,
               sizeof(struct ethtool_ops));
Yes, i noticed this. I also expect the compiler has also noticed, and
has optimized away one of the parameters.
 
I sure could simplify that and use ds->dst instead if you find it more
elegant, works for me.
I would prefer the code to be consistent. Either use ds->dst
everywhere and drop the parameter, or use the parameter everywhere it
is usable.

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