aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/clk-mux.c
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2022-04-24 19:22:27 +0100
committerStephen Boyd <sboyd@kernel.org>2022-04-25 15:49:20 -0700
commit14364fca21208d0954d594e1eccb4ad239881081 (patch)
treec622b04e2b6ed37534f47719cb65af55445a3047 /drivers/clk/clk-mux.c
parentclk: using pm_runtime_resume_and_get instead of pm_runtime_get_sync (diff)
downloadwireguard-linux-14364fca21208d0954d594e1eccb4ad239881081.tar.xz
wireguard-linux-14364fca21208d0954d594e1eccb4ad239881081.zip
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>
Diffstat (limited to 'drivers/clk/clk-mux.c')
-rw-r--r--drivers/clk/clk-mux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 214045f6e989..fa817c317c2a 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -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);