[PATCH] clk: fix passing zero to warning in clk_hw_create_clk()

From: F.A.Sulaiman
Date: Fri Aug 27 2021 - 07:41:45 EST


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 <asha.16@xxxxxxxxxxxxxxx>
---
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;
--
2.17.1