提交 e8f0e68e 编写于 作者: M Masahiro Yamada 提交者: Stephen Boyd

clk: slightly optimize clk_core_set_parent()

If clk_fetch_parent_index() fails, p_rate is unused.  Move the
assignment after the error checking.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 470b5e2f
......@@ -1748,13 +1748,13 @@ static int clk_core_set_parent(struct clk_core *core, struct clk_core *parent)
/* try finding the new parent index */
if (parent) {
p_index = clk_fetch_parent_index(core, parent);
p_rate = parent->rate;
if (p_index < 0) {
pr_debug("%s: clk %s can not be parent of clk %s\n",
__func__, parent->name, core->name);
ret = p_index;
goto out;
}
p_rate = parent->rate;
}
/* propagate PRE_RATE_CHANGE notifications */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册