android_kernel_xiaomi_sm7250/drivers/clk/sunxi
Nathan Chancellor 49ade064ea clk: sunxi: Fix operator precedence in sunxi_divs_clk_setup
[ Upstream commit afdc74ed2d57e86c10b1d6831339770a802bab9a ]

r375326 in Clang exposes an issue with operator precedence in
sunxi_div_clk_setup:

drivers/clk/sunxi/clk-sunxi.c:1083:30: warning: operator '?:' has lower
precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]
                                                 data->div[i].critical ?
                                                 ~~~~~~~~~~~~~~~~~~~~~ ^
drivers/clk/sunxi/clk-sunxi.c:1083:30: note: place parentheses around
the '|' expression to silence this warning
                                                 data->div[i].critical ?
                                                                       ^
                                                                      )
drivers/clk/sunxi/clk-sunxi.c:1083:30: note: place parentheses around
the '?:' expression to evaluate it first
                                                 data->div[i].critical ?
                                                                       ^
                                                 (
1 warning generated.

It appears that the intention was for ?: to be evaluated first so that
CLK_IS_CRITICAL could be added to clkflags if the critical boolean was
set; right now, | is being evaluated first. Add parentheses around the
?: block to have it be evaluated first.

Fixes: 9919d44ff2 ("clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks")
Link: https://github.com/ClangBuiltLinux/linux/issues/745
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-05 09:19:38 +01:00
..
clk-a10-codec.c
clk-a10-hosc.c
clk-a10-mod1.c
clk-a10-pll2.c
clk-a10-ve.c
clk-a20-gmac.c
clk-factors.c
clk-factors.h
clk-mod0.c
clk-simple-gates.c
clk-sun4i-display.c
clk-sun4i-pll3.c
clk-sun4i-tcon-ch1.c
clk-sun6i-apb0-gates.c
clk-sun6i-apb0.c
clk-sun6i-ar100.c
clk-sun8i-apb0.c
clk-sun8i-bus-gates.c
clk-sun8i-mbus.c
clk-sun9i-core.c
clk-sun9i-cpus.c
clk-sun9i-mmc.c
clk-sunxi.c
clk-usb.c
Makefile