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: <CAPDyKFrADVAs2zK2FY5sOh0R=8Kgsm9GwAKkbV9pfdczt07QOg@mail.gmail.com>
Date:   Mon, 7 Sep 2020 12:07:06 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Xu Wang <vulab@...as.ac.cn>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        "Dr. H. Nikolaus Schaller" <hns@...delico.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Rui Miguel Silva <rmfrfs@...il.com>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        linux-omap <linux-omap@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: host: omap-hsmmc: remove redundant null check

On Thu, 3 Sep 2020 at 10:48, Xu Wang <vulab@...as.ac.cn> wrote:
>
> Because clk_disable_unprepare already checked NULL clock
> parameter, so the additional checks are unnecessary, just remove them.
>
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/omap_hsmmc.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 37b8740513f5..d02983e23ed1 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1114,8 +1114,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
>         int ret;
>
>         /* Disable the clocks */
> -       if (host->dbclk)
> -               clk_disable_unprepare(host->dbclk);
> +       clk_disable_unprepare(host->dbclk);
>
>         /* Turn the power off */
>         ret = omap_hsmmc_set_power(host, 0);
> @@ -1123,8 +1122,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
>         /* Turn the power ON with given VDD 1.8 or 3.0v */
>         if (!ret)
>                 ret = omap_hsmmc_set_power(host, 1);
> -       if (host->dbclk)
> -               clk_prepare_enable(host->dbclk);
> +       clk_prepare_enable(host->dbclk);
>
>         if (ret != 0)
>                 goto err;
> @@ -2014,8 +2012,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>         pm_runtime_dont_use_autosuspend(host->dev);
>         pm_runtime_put_sync(host->dev);
>         pm_runtime_disable(host->dev);
> -       if (host->dbclk)
> -               clk_disable_unprepare(host->dbclk);
> +       clk_disable_unprepare(host->dbclk);
>  err1:
>         mmc_free_host(mmc);
>  err:
> @@ -2037,8 +2034,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
>         pm_runtime_put_sync(host->dev);
>         pm_runtime_disable(host->dev);
>         device_init_wakeup(&pdev->dev, false);
> -       if (host->dbclk)
> -               clk_disable_unprepare(host->dbclk);
> +       clk_disable_unprepare(host->dbclk);
>
>         mmc_free_host(host->mmc);
>
> @@ -2063,8 +2059,7 @@ static int omap_hsmmc_suspend(struct device *dev)
>                                 OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
>         }
>
> -       if (host->dbclk)
> -               clk_disable_unprepare(host->dbclk);
> +       clk_disable_unprepare(host->dbclk);
>
>         pm_runtime_put_sync(host->dev);
>         return 0;
> @@ -2080,8 +2075,7 @@ static int omap_hsmmc_resume(struct device *dev)
>
>         pm_runtime_get_sync(host->dev);
>
> -       if (host->dbclk)
> -               clk_prepare_enable(host->dbclk);
> +       clk_prepare_enable(host->dbclk);
>
>         if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
>                 omap_hsmmc_conf_bus_power(host);
> --
> 2.17.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ