Skip to content

Commit 4e31bfa

Browse files
nathanchancebebarino
authored andcommitted
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. Fixes: b4cbe60 ("clk: visconti: Add support common clock driver and reset driver") Link: ClangBuiltLinux#1564 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20220107183303.2337676-1-nathan@kernel.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 70faf94 commit 4e31bfa

File tree

1 file changed

+1
-1
lines changed
  • drivers/clk/visconti

1 file changed

+1
-1
lines changed

drivers/clk/visconti/pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static void visconti_pll_add_lookup(struct visconti_pll_provider *ctx,
289289
struct clk_hw *hw_clk,
290290
unsigned int id)
291291
{
292-
if (ctx->clk_data.hws && id)
292+
if (id)
293293
ctx->clk_data.hws[id] = hw_clk;
294294
}
295295

0 commit comments

Comments
 (0)