Skip to content

Commit

Permalink
clk: mux: remove redundant initialization of variable width
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Stephen Boyd committed Apr 25, 2022
1 parent 3196a60 commit 14364fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/clk/clk-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
struct clk_mux *mux;
struct clk_hw *hw;
struct clk_init_data init = {};
u8 width = 0;
int ret = -EINVAL;

if (clk_mux_flags & CLK_MUX_HIWORD_MASK) {
width = fls(mask) - ffs(mask) + 1;
u8 width = fls(mask) - ffs(mask) + 1;

if (width + shift > 16) {
pr_err("mux value exceeds LOWORD field\n");
return ERR_PTR(-EINVAL);
Expand Down

0 comments on commit 14364fc

Please sign in to comment.