LKML Archive on
help / color / mirror / Atom feed
From: "F.A.Sulaiman" <>
Cc: "F.A.Sulaiman" <>,,
Subject: [PATCH] clk: fix passing zero to warning in clk_hw_create_clk()
Date: Fri, 27 Aug 2021 17:11:15 +0530	[thread overview]
Message-ID: <> (raw)

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;

                 reply	other threads:[~2021-08-27 11:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH] clk: fix passing zero to warning in clk_hw_create_clk()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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