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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 8 Jan 2021 09:19:55 +0000
From:   "Sa, Nuno" <Nuno.Sa@...log.com>
To:     Xu Wang <vulab@...as.ac.cn>, "lars@...afoo.de" <lars@...afoo.de>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] ASoC: adau17x1: Remove redundant null check before
 clk_disable_unprepare


> -----Original Message-----
> From: Xu Wang <vulab@...as.ac.cn>
> Sent: Friday, January 8, 2021 9:45 AM
> To: lars@...afoo.de; Sa, Nuno <Nuno.Sa@...log.com>;
> lgirdwood@...il.com; broonie@...nel.org; perex@...ex.cz;
> tiwai@...e.com; alsa-devel@...a-project.org
> Cc: linux-kernel@...r.kernel.org
> Subject: [PATCH] ASoC: adau17x1: Remove redundant null check
> before clk_disable_unprepare
> 
> 
> Because clk_disable_unprepare() already checked NULL clock
> parameter,
> so the additional check is unnecessary, just remove it.
> 
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>
> ---
>  sound/soc/codecs/adau17x1.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/adau17x1.c
> b/sound/soc/codecs/adau17x1.c
> index 30e072c80ac1..546ee8178038 100644
> --- a/sound/soc/codecs/adau17x1.c
> +++ b/sound/soc/codecs/adau17x1.c
> @@ -1095,8 +1095,7 @@ void adau17x1_remove(struct device *dev)
>  {
>  	struct adau *adau = dev_get_drvdata(dev);
> 
> -	if (adau->mclk)
> -		clk_disable_unprepare(adau->mclk);
> +	clk_disable_unprepare(adau->mclk);
>  }
>  EXPORT_SYMBOL_GPL(adau17x1_remove);

This is fine by me but since you are touching this, you could also just replace the
remove() hook in all the users with devm_add_action_or_reset().

- Nuno Sá

Powered by blists - more mailing lists