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] [thread-next>] [day] [month] [year] [list]
Message-ID: <2660e72f-e2a2-48d1-8571-b738d9739917@web.de>
Date: Sun, 16 Jun 2024 19:26:29 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Konrad Dybcio <konrad.dybcio@...aro.org>,
 Mohammad Rafi Shaik <quic_mohs@...cinc.com>,
 Prasad Kumpatla <quic_pkumpatl@...cinc.com>, alsa-devel@...a-project.org,
 linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
 linux-arm-msm@...r.kernel.org, Banajit Goswami <bgoswami@...cinc.com>,
 Conor Dooley <conor+dt@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Liam Girdwood
 <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
 Rob Herring <robh@...nel.org>,
 Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
 Takashi Iwai <tiwai@...e.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Rohit kumar <quic_rohkumar@...cinc.com>,
 Christophe Jaillet <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver

…
> +++ b/sound/soc/codecs/wcd937x.c
> @@ -0,0 +1,1677 @@
…
> +static bool wcd937x_mbhc_get_moisture_status(struct snd_soc_component *component)
> +{
> +	struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component);
> +	bool ret = false;
> +
> +	if (wcd937x->mbhc_cfg.moist_rref == R_OFF) {
> +		snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2,
> +					      WCD937X_M_RTH_CTL_MASK, R_OFF);
> +		goto done;
> +	}

I suggest to use the following statement.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.10-rc3#n532

+		return false;



…
> +	/* Read moisture comparator status */
> +	ret = ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS)
> +				       & 0x20) ? 0 : 1);
> +done:
> +	return ret;
> +}
…

How do you think about to use the following statement instead?

+	return (snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) & 0x20) ? false : true;


May the local variable “ret” and the label “done” be omitted
in this function implementation finally?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ