clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup()
Subsystems (2)
PATCH 1/1 clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup()
Clang warns:
drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (ctx->clk_data.hws && id)
~~~~~~~~~~~~~~^~~ ~~1 warning generated.
This array cannot be NULL if ctx is not NULL, which is allocated in visconti_init_pll(), so just remove the check, which matches other clk drivers.
--- drivers/clk/visconti/pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/visconti/pll.c +1 -1
@@ -289,7 +289,7 @@ static void visconti_pll_add_lookup(struct visconti_pll_provider *ctx,struct clk_hw *hw_clk, unsigned int id) { - if (ctx->clk_data.hws && id) + if (id) ctx->clk_data.hws[id] = hw_clk; }
base-commit: 70faf946ad975c64efb2eb809f9139f304a494b0
Signature · 1 line
2.34.1
Quoting Nathan Chancellor (2022-01-07 10:33:03)
Quoted 11 lines
Clang warns:
drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true' [-Wpointer-bool-conversion]if (ctx->clk_data.hws && id) ~~~~~~~~~~~~~~^~~ ~~1 warning generated.
This array cannot be NULL if ctx is not NULL, which is allocated in
visconti_init_pll(), so just remove the check, which matches other clk drivers.
Quoted 5 lines
Fixes b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver")Reported-by kernel test robot <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>---
Applied to clk-next
Hi Nathan,
Thanks for your patch.
Quoted 24 lines
-----Original Message-----
From: Nathan Chancellor <[email protected]>
Sent: Saturday, January 8, 2022 3:33 AM
To: Michael Turquette <[email protected]>; Stephen Boyd <[email protected]>; iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT) <[email protected]>
Cc: Nick Desaulniers <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Nathan Chancellor <[email protected]>; kernel test robot <[email protected]>
Subject: [PATCH] clk: visconti: Remove pointless NULL check invisconti_pll_add_lookup()Clang warns:
drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true' [-Wpointer-bool-conversion]if (ctx->clk_data.hws && id) ~~~~~~~~~~~~~~^~~ ~~1 warning generated.
This array cannot be NULL if ctx is not NULL, which is allocated in
visconti_init_pll(), so just remove the check, which matches other clk drivers.
Quoted 8 lines
Fixes b4cbe606dc36 ("clk: visconti: Add support common clock driver andreset driver")
Reported-by kernel test robot <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>--- drivers/clk/visconti/pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Best regards,
Nobuhiro