From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v1 2/2 RESEND] ASoC: codecs: Add support for Fortemedia FM34NE DSP
Date: Tue, 13 Oct 2026 18:54:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-170356@kernel.org> (raw)
In-Reply-To: <20261013184755.530392-3-clamor95@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] asoc: fm34ne-dsp: I2C transfer errors are silently masked by unconditional return 0
- [Low] asoc: fm34ne-dsp: mixing goto-based cleanup with guard() scope-based locking
--
commit c702ef2250bbc5a4eaf5b40b9bb43fc3e069825a
Author: Svyatoslav Ryhel <clamor95@gmail.com>
ASoC: codecs: Add support for Fortemedia FM34NE DSP
This commit introduces a new I2C-based ALSA SoC codec driver for the
Fortemedia FM34NE DSP. This chip is primarily used for active noise
suppression on devices like the ASUS Transformers.
> diff --git a/sound/soc/codecs/fm34ne-dsp.c b/sound/soc/codecs/fm34ne-dsp.c
> new file mode 100644
> index 0000000000000..74520e37c1d1a
> --- /dev/null
> +++ b/sound/soc/codecs/fm34ne-dsp.c
> @@ -0,0 +1,388 @@
[ ... ]
> +static int fm34ne_dsp_set_config(struct fm34ne_dsp *dsp, enum dsp_state state)
> +{
> + struct device *dev = &dsp->client->dev;
> + int ret;
> +
> + guard(mutex)(&dsp->lock);
> +
> + gpiod_set_value_cansleep(dsp->bypass_gpio, 1);
> + msleep(20);
> +
> + switch (state) {
> + case FM34NE_NS_ENABLE:
> + ret = i2c_master_send(dsp->client, dsp->info->enable_parameter,
> + dsp->info->enable_parameter_length);
> + if (ret < 0) {
> + dev_err(dev, "Failed to set DSP enable %d\n", ret);
> + goto exit;
[Severity: Low]
Does this mix goto-based error cleanup with scope-based locking?
According to the kernel's cleanup helpers documentation, the expectation
is that the usage of goto labels and scope-based cleanup helpers (like
guard) should not be mixed in the same function. This is to avoid confusing
ownership and lock release semantics. Could this be converted entirely to
scope-based cleanup, or stick to traditional locking?
> + }
> +
> + ret = i2c_master_send(dsp->client, dsp->info->enable_noise_suppression,
> + dsp->info->enable_ns_length);
> + if (ret < 0) {
> + dev_err(dev, "Failed to enable DSP noise suppression %d\n", ret);
> + goto exit;
> + }
> +
> + break;
[ ... ]
> +exit:
> + gpiod_set_value_cansleep(dsp->bypass_gpio, 0);
> +
> + return 0;
[Severity: Medium]
Does this unconditionally discard the error code returned by
i2c_master_send on the failure paths?
By returning 0 here after jumping to the exit label, callers like
fm34ne_dsp_probe will assume the hardware was successfully configured
even if the underlying I2C transfer failed. Should this propagate the
negative error code stored in ret instead?
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013184755.530392-1-clamor95@gmail.com?part=2
next prev parent reply other threads:[~2026-10-13 18:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 18:47 [PATCH v1 0/2 RESEND] ASoC: codecs: Add support for Fortemedia FM34NE DSP Svyatoslav Ryhel
2026-10-13 18:47 ` [PATCH v1 1/2 RESEND] ASoC: dt-bindings: Document " Svyatoslav Ryhel
2026-10-13 18:56 ` sashiko-bot
2026-10-13 18:47 ` [PATCH v1 2/2 RESEND] ASoC: codecs: Add support for Fortemedia " Svyatoslav Ryhel
2026-10-13 18:54 ` sashiko-bot [this message]
2026-10-13 18:49 ` [PATCH v1 0/2 " Mark Brown
2026-10-13 18:51 ` Svyatoslav Ryhel
2026-10-13 18:55 ` Mark Brown
2026-10-13 18:56 ` Svyatoslav Ryhel
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=sashiko-outbox-170356@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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