From: Sean Wang Date: Mon, 17 Jul 2017 06:01:19 +0000 (+0800) Subject: clk: mediatek: fixed static checker warning in clk_cpumux_get_parent call X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa12167cedea353e71dfb776023b84381305b4d9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git clk: mediatek: fixed static checker warning in clk_cpumux_get_parent call Fixed the signedness bug returning '(-22)' on the return type as u8 with removing the sanity checker in clk_cpumux_get_parent() since clk_cpumux_set_parent() always ensures validity in clk_cpumux_get_parent() got called. Fixes: 1e17de9049da ("clk: mediatek: add missing cpu mux causing Mediatek cpufreq can't work") Reported-by: Dan Carpenter Signed-off-by: Sean Wang Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c index edd8e6918050..347d7990b30f 100644 --- a/drivers/clk/mediatek/clk-cpumux.c +++ b/drivers/clk/mediatek/clk-cpumux.c @@ -27,7 +27,6 @@ static inline struct mtk_clk_cpumux *to_mtk_clk_cpumux(struct clk_hw *_hw) static u8 clk_cpumux_get_parent(struct clk_hw *hw) { struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); - int num_parents = clk_hw_get_num_parents(hw); unsigned int val; regmap_read(mux->regmap, mux->reg, &val); @@ -35,9 +34,6 @@ static u8 clk_cpumux_get_parent(struct clk_hw *hw) val >>= mux->shift; val &= mux->mask; - if (val >= num_parents) - return -EINVAL; - return val; }