From: Markus Elfring <Markus.Elfring@web.de>
To: Konrad Dybcio <konrad.dybcio@linaro.org>,
Mohammad Rafi Shaik <quic_mohs@quicinc.com>,
Prasad Kumpatla <quic_pkumpatl@quicinc.com>,
alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Banajit Goswami <bgoswami@quicinc.com>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Takashi Iwai <tiwai@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Rohit kumar <quic_rohkumar@quicinc.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver
Date: Sun, 16 Jun 2024 19:26:29 +0200 [thread overview]
Message-ID: <2660e72f-e2a2-48d1-8571-b738d9739917@web.de> (raw)
In-Reply-To: <20240611074557.604250-4-quic_mohs@quicinc.com>
…
> +++ 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
next prev parent reply other threads:[~2024-06-16 17:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 7:45 [PATCH v6 0/7] ASoC: codecs: wcd937x: add wcd937x audio codec support Mohammad Rafi Shaik
2024-06-11 7:45 ` [PATCH v6 1/7] ASoC: dt-bindings: document wcd937x Audio Codec Mohammad Rafi Shaik
2024-06-11 7:45 ` [PATCH v6 2/7] ASoC: codecs: wcd937x-sdw: add SoundWire driver Mohammad Rafi Shaik
2024-06-16 16:23 ` Markus Elfring
2024-06-11 7:45 ` [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver Mohammad Rafi Shaik
2024-06-16 14:54 ` Christophe JAILLET
2024-06-17 11:55 ` Mark Brown
2024-06-19 11:02 ` Mohammad Rafi Shaik
2024-06-19 20:45 ` Christophe JAILLET
2024-06-16 15:06 ` [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver - another comment Christophe JAILLET
2024-06-16 16:38 ` [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver Markus Elfring
2024-06-17 11:54 ` Mark Brown
2024-06-17 12:32 ` [v6 " Markus Elfring
2024-06-16 17:26 ` Markus Elfring [this message]
2024-06-11 7:45 ` [PATCH v6 4/7] ASoC: codecs: wcd937x: add basic controls Mohammad Rafi Shaik
2024-06-11 7:45 ` [PATCH v6 5/7] ASoC: codecs: wcd937x: add playback dapm widgets Mohammad Rafi Shaik
2024-06-11 7:45 ` [PATCH v6 6/7] ASoC: codecs: wcd937x: add capture " Mohammad Rafi Shaik
2024-06-11 7:45 ` [PATCH v6 7/7] ASoC: codecs: wcd937x: add audio routing and Kconfig Mohammad Rafi Shaik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2660e72f-e2a2-48d1-8571-b738d9739917@web.de \
--to=markus.elfring@web.de \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=quic_mohs@quicinc.com \
--cc=quic_pkumpatl@quicinc.com \
--cc=quic_rohkumar@quicinc.com \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox