提交 c9c2deef 编写于 作者: S Sachin Kamat 提交者: Greg Kroah-Hartman

thunderbolt: Use NULL instead of 0 in switch.c

The function returns a pointer. Hence return NULL instead of 0.
Signed-off-by: NSachin Kamat <sachin.kamat@samsung.com>
Acked-by: NAndreas Noever <andreas.noever@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 10fefe56
......@@ -260,11 +260,11 @@ struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route)
if (route == 0)
return sw;
if (next_port > sw->config.max_port_number)
return 0;
return NULL;
if (tb_is_upstream_port(&sw->ports[next_port]))
return 0;
return NULL;
if (!sw->ports[next_port].remote)
return 0;
return NULL;
return get_switch_at_route(sw->ports[next_port].remote->sw,
route >> TB_ROUTE_SHIFT);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册