From: sashiko-bot@kernel.org
To: "Charles Keepax" <ckeepax@opensource.cirrus.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 2/3] ASoC: cs42l43: Factor out decimator startup data to an array
Date: Mon, 02 Nov 2026 16:05:51 +0000 [thread overview]
Message-ID: <sashiko-outbox-193729@kernel.org> (raw)
In-Reply-To: <20261102155440.3995136-3-ckeepax@opensource.cirrus.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] ASoC: cs42l43: missing static const on decim_info lookup tables
--
commit aad56061661af8b4127504548c049c31c4e54dca
Author: Charles Keepax <ckeepax@opensource.cirrus.com>
ASoC: cs42l43: Factor out decimator startup data to an array
This commit replaces the variant-specific switch statements in
cs42l43_mic_ev() with the cs42l43_decim_info and cs42l43b_decim_info lookup
arrays indexed by w->shift.
> diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
> index 90c83bb33d69b..17d55a3de9de3 100644
> --- a/sound/soc/codecs/cs42l43.c
> +++ b/sound/soc/codecs/cs42l43.c
> @@ -1736,97 +1736,82 @@ static int cs42l43_hp_ev(struct snd_soc_dapm_widget *w,
> return 0;
> }
>
> +struct decim_info {
> + unsigned int vreg;
> + unsigned int vmask;
> +};
> +
> +struct decim_info cs42l43_decim_info[] = {
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM1_VD_RAMP_MASK | CS42L43_DECIM1_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM2_VD_RAMP_MASK | CS42L43_DECIM2_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM1_VD_RAMP_MASK | CS42L43_DECIM1_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM2_VD_RAMP_MASK | CS42L43_DECIM2_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH3_CH4,
> + .vmask = CS42L43_DECIM3_VD_RAMP_MASK | CS42L43_DECIM3_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43_DECIM_VOL_CTRL_CH3_CH4,
> + .vmask = CS42L43_DECIM4_VD_RAMP_MASK | CS42L43_DECIM4_MUTE_MASK,
> + }
> +};
> +
> +struct decim_info cs42l43b_decim_info[] = {
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM1_VD_RAMP_MASK | CS42L43_DECIM1_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH1_CH2,
> + .vmask = CS42L43_DECIM2_VD_RAMP_MASK | CS42L43_DECIM2_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH3_CH4,
> + .vmask = CS42L43_DECIM3_VD_RAMP_MASK | CS42L43_DECIM3_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH3_CH4,
> + .vmask = CS42L43_DECIM4_VD_RAMP_MASK | CS42L43_DECIM4_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH5_CH6,
> + .vmask = CS42L43B_DECIM5_PATH1_VOL_FALL_RATE_MASK | CS42L43B_DECIM5_MUTE_MASK,
> + },
> + {
> + .vreg = CS42L43B_DECIM_VOL_CTRL_CH5_CH6,
> + .vmask = CS42L43B_DECIM6_PATH1_VOL_FALL_RATE_MASK | CS42L43B_DECIM6_MUTE_MASK,
> + }
> +};
> +
> static int cs42l43_mic_ev(struct snd_soc_dapm_widget *w,
> struct snd_kcontrol *kcontrol, int event)
> {
> struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component);
> + struct decim_info *info = &cs42l43_decim_info[w->shift];
[Severity: Low]
Should cs42l43_decim_info and cs42l43b_decim_info in
sound/soc/codecs/cs42l43.c be declared static const (and info in
cs42l43_mic_ev() be a const struct decim_info *)?
Both tables are only used within sound/soc/codecs/cs42l43.c and are never
modified. Without static const, they are placed in writable .data instead of
.rodata and trigger -Wmissing-variable-declarations and Sparse warnings when
building with W=1 or C=1.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261102155440.3995136-1-ckeepax@opensource.cirrus.com?part=2
next prev parent reply other threads:[~2026-11-02 16:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 15:54 [PATCH 0/3] Improve pop performance of cs42l43 input path Charles Keepax
2026-11-02 15:54 ` [PATCH 1/3] ASoC: cs42l43: Improve analogue mic pop performance Charles Keepax
2026-11-02 15:54 ` [PATCH 2/3] ASoC: cs42l43: Factor out decimator startup data to an array Charles Keepax
2026-11-02 16:05 ` sashiko-bot [this message]
2026-11-02 17:07 ` Mark Brown
2026-11-02 15:54 ` [PATCH 3/3] ASoC: cs42l43: Improve pop performance of the input power up Charles Keepax
2026-11-02 16:15 ` sashiko-bot
2026-11-02 16:59 ` Charles Keepax
2026-11-02 17:07 ` Mark Brown
2026-11-03 9:39 ` Charles Keepax
2026-11-03 11:49 ` Charles Keepax
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-193729@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=linux-sound@vger.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