lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220730010056.7CF6BC433D6@smtp.kernel.org>
Date:   Fri, 29 Jul 2022 18:00:54 -0700
From:   Stephen Boyd <sboyd@...nel.org>
To:     Yang Yingliang <yangyingliang@...wei.com>,
        linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     abelvesa@...nel.org, shawnguo@...nel.org
Subject: Re: [PATCH -next] clk: imx: remove unnecessary NULL check of clk

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@...wei.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ