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]
Date:   Tue, 20 Oct 2020 13:19:13 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Olivier Moysan <olivier.moysan@...com>
Cc:     lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.com,
        alexandre.torgue@...com, arnaud.patard@...-net.org,
        alsa-devel@...a-project.org, linux-arm-kernel@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-kernel@...r.kernel.org, arnaud.pouliquen@...com
Subject: Re: [PATCH] ASoC: cs42l51: manage mclk shutdown delay

On Tue, Oct 20, 2020 at 11:04:57AM +0200, Olivier Moysan wrote:

> +static int mclk_event(struct snd_soc_dapm_widget *w,
> +		      struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm);
> +	struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(comp);
> +
> +	if (SND_SOC_DAPM_EVENT_ON(event))
> +		return clk_prepare_enable(cs42l51->mclk_handle);
> +
> +	/* Delay mclk shutdown to fulfill power-down sequence requirements */
> +	msleep(20);
> +	clk_disable_unprepare(cs42l51->mclk_handle);

Why not use a switch statement here?  The control flow is a bit odd with
what's basically an if/else done with only one branch in the if - this
isn't idiomatic for DAPM stuff apart from anything else.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ