All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-clk@vger.kernel.org>
Cc: <abelvesa@kernel.org>, <shawnguo@kernel.org>
Subject: [PATCH -next] clk: imx: remove unnecessary NULL check of clk
Date: Thu, 30 Jun 2022 22:13:08 +0800	[thread overview]
Message-ID: <20220630141308.121526-1-yangyingliang@huawei.com> (raw)

It has NULL check in clk_prepare_enable(), so it no need
to check the clk before calling it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/clk/imx/clk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
index 5582f18dd632..1c5d5b957c96 100644
--- a/drivers/clk/imx/clk.c
+++ b/drivers/clk/imx/clk.c
@@ -189,9 +189,7 @@ void imx_register_uart_clocks(unsigned int clk_count)
 			if (IS_ERR(imx_uart_clocks[imx_enabled_uart_clocks]))
 				return;
 
-			/* Only enable the clock if it's not NULL */
-			if (imx_uart_clocks[imx_enabled_uart_clocks])
-				clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
+			clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
 		}
 	}
 #endif
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-clk@vger.kernel.org>
Cc: <abelvesa@kernel.org>, <shawnguo@kernel.org>
Subject: [PATCH -next] clk: imx: remove unnecessary NULL check of clk
Date: Thu, 30 Jun 2022 22:13:08 +0800	[thread overview]
Message-ID: <20220630141308.121526-1-yangyingliang@huawei.com> (raw)

It has NULL check in clk_prepare_enable(), so it no need
to check the clk before calling it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/clk/imx/clk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
index 5582f18dd632..1c5d5b957c96 100644
--- a/drivers/clk/imx/clk.c
+++ b/drivers/clk/imx/clk.c
@@ -189,9 +189,7 @@ void imx_register_uart_clocks(unsigned int clk_count)
 			if (IS_ERR(imx_uart_clocks[imx_enabled_uart_clocks]))
 				return;
 
-			/* Only enable the clock if it's not NULL */
-			if (imx_uart_clocks[imx_enabled_uart_clocks])
-				clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
+			clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]);
 		}
 	}
 #endif
-- 
2.25.1


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

             reply	other threads:[~2022-06-30 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 14:13 Yang Yingliang [this message]
2022-06-30 14:13 ` [PATCH -next] clk: imx: remove unnecessary NULL check of clk Yang Yingliang
2022-07-30  1:00 ` Stephen Boyd
2022-07-30  1:00   ` Stephen Boyd

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220630141308.121526-1-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=abelvesa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.