Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: mux: remove redundant initialization of variable width

Variable width is being ininitialized with a value that is never read.
The ininitializtion is redundant and can be removed. Move the variable
to the scope it is required.

Cleans up cppcheck warning:
Variable 'width' is assigned a value that is never used.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220424182227.1364966-1-colin.i.king@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Colin Ian King and committed by
Stephen Boyd
14364fca 3196a605

+2 -2
+2 -2
drivers/clk/clk-mux.c
··· 157 157 struct clk_mux *mux; 158 158 struct clk_hw *hw; 159 159 struct clk_init_data init = {}; 160 - u8 width = 0; 161 160 int ret = -EINVAL; 162 161 163 162 if (clk_mux_flags & CLK_MUX_HIWORD_MASK) { 164 - width = fls(mask) - ffs(mask) + 1; 163 + u8 width = fls(mask) - ffs(mask) + 1; 164 + 165 165 if (width + shift > 16) { 166 166 pr_err("mux value exceeds LOWORD field\n"); 167 167 return ERR_PTR(-EINVAL);