mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: abelvesa@kernel.org, shawnguo@kernel.org
Subject: Re: [PATCH -next] clk: imx: remove unnecessary NULL check of clk
Date: Fri, 29 Jul 2022 18:00:54 -0700	[thread overview]
Message-ID: <20220730010056.7CF6BC433D6@smtp.kernel.org> (raw)
In-Reply-To: <20220630141308.121526-1-yangyingliang@huawei.com>

Quoting Yang Yingliang (2022-06-30 07:13:08)
> 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++]);

Nak

The ++ operator has side-effects, which wasn't the case before this
patch.

      reply	other threads:[~2022-07-30  1:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 14:13 Yang Yingliang
2022-07-30  1:00 ` Stephen Boyd [this message]

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=20220730010056.7CF6BC433D6@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --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 \
    --cc=yangyingliang@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome