提交 b96ddf25 编写于 作者: V Vivien Didelot 提交者: Jakub Kicinski

net: dsa: use ports list in dsa_to_port

Use the new ports list instead of accessing the dsa_switch array
of ports in the dsa_to_port helper.
Signed-off-by: NVivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
上级 ab8ccae1
......@@ -285,7 +285,14 @@ struct dsa_switch {
static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)
{
return &ds->ports[p];
struct dsa_switch_tree *dst = ds->dst;
struct dsa_port *dp = NULL;
list_for_each_entry(dp, &dst->ports, list)
if (dp->ds == ds && dp->index == p)
break;
return dp;
}
static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册