Thread (10 messages) 10 messages, 2 authors, 2019-10-31

Re: [PATCH net-next 1/7] net: dsa: list DSA links in the fabric

From: David Miller <davem@davemloft.net>
Date: 2019-10-30 21:39:52
Also in: lkml

From: Vivien Didelot <redacted>
Date: Mon, 28 Oct 2019 15:52:14 -0400
quoted hunk ↗ jump to hunk
@@ -122,6 +124,29 @@ static struct dsa_port *dsa_tree_find_port_by_node(struct dsa_switch_tree *dst,
 	return NULL;
 }
 
+struct dsa_link *dsa_link_touch(struct dsa_port *dp, struct dsa_port *link_dp)
+{
+	struct dsa_switch *ds = dp->ds;
+	struct dsa_switch_tree *dst = ds->dst;
+	struct dsa_link *dl;
Please fix the reverse christmas tree here, two suggestions:

	struct dsa_switch *ds = dp->ds;
	struct dsa_switch_tree *dst;
	struct dsa_link *dl;

	dst = ds->dst;

Or, alternatively, since the dst variable is used only once, get rid of it
and change:
+	list_add_tail(&dl->list, &dst->rtable);
to
+	list_add_tail(&dl->list, &ds->dst->rtable);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help