Skip to content

Commit 14364fc

Browse files
ColinIanKingbebarino
authored andcommitted
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>
1 parent 3196a60 commit 14364fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/clk/clk-mux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
157157
struct clk_mux *mux;
158158
struct clk_hw *hw;
159159
struct clk_init_data init = {};
160-
u8 width = 0;
161160
int ret = -EINVAL;
162161

163162
if (clk_mux_flags & CLK_MUX_HIWORD_MASK) {
164-
width = fls(mask) - ffs(mask) + 1;
163+
u8 width = fls(mask) - ffs(mask) + 1;
164+
165165
if (width + shift > 16) {
166166
pr_err("mux value exceeds LOWORD field\n");
167167
return ERR_PTR(-EINVAL);

0 commit comments

Comments
 (0)