linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup()
@ 2022-01-07 18:33 Nathan Chancellor
  2022-01-08  0:08 ` Stephen Boyd
  2022-01-11  0:38 ` nobuhiro1.iwamatsu
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-01-07 18:33 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu
  Cc: Nick Desaulniers, linux-clk, linux-arm-kernel, linux-kernel, llvm,
	Nathan Chancellor, kernel test robot

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.

Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1564
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/clk/visconti/pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c
index 3b6e88bb73d5..a2398bc6c6e4 100644
--- a/drivers/clk/visconti/pll.c
+++ b/drivers/clk/visconti/pll.c
@@ -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
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-11  0:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-07 18:33 [PATCH] clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup() Nathan Chancellor
2022-01-08  0:08 ` Stephen Boyd
2022-01-11  0:38 ` nobuhiro1.iwamatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).