LKML Archive on
help / color / mirror / Atom feed
* [PATCH] clk: fix passing zero to warning in clk_hw_create_clk()
@ 2021-08-27 11:41 F.A.Sulaiman
  0 siblings, 0 replies; only message in thread
From: F.A.Sulaiman @ 2021-08-27 11:41 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: F.A.Sulaiman, linux-clk, linux-kernel

Smatch has reported passing to zero warning in ERR_CAST.
"drivers/clk/clk.c:3673 clk_hw_create_clk() warn: passing zero to 'ERR_CAST'"

This patch resolves it by using IS_ERR instead of IS_ERR_OR_NULL.

Signed-off-by: F.A. SULAIMAN <>
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 65508eb89ec9..cf47526789af 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3669,7 +3669,7 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
 	struct clk_core *core;
 	/* This is to allow this function to be chained to others */
-	if (IS_ERR_OR_NULL(hw))
+	if (IS_ERR(hw))
 		return ERR_CAST(hw);
 	core = hw->core;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27 11:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 11:41 [PATCH] clk: fix passing zero to warning in clk_hw_create_clk() F.A.Sulaiman

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).