All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [bug report] ASoC: SDCA: Create DAPM widgets and routes from DisCo
Date: Tue, 27 May 2025 15:43:16 +0100	[thread overview]
Message-ID: <aDXPhD09VI0jrvZQ@opensource.cirrus.com> (raw)
In-Reply-To: <aDWOKjGYd4Qye3Co@stanley.mountain>

On Tue, May 27, 2025 at 01:04:26PM +0300, Dan Carpenter wrote:
> sound/soc/sdca/sdca_asoc.c
>     377 static int entity_pde_event(struct snd_soc_dapm_widget *widget,
>     378                             struct snd_kcontrol *kctl, int event)
>     379 {
>     380         struct snd_soc_component *component = widget->dapm->component;
>     381         struct sdca_entity *entity = widget->priv;
>     382         static const int polls = 100;
>     383         unsigned int reg, val;
>     384         int from, to, i;
>     385         int poll_us;
>     386         int ret;
>     387 
>     388         if (!component)
>     389                 return -EIO;
>     390 
>     391         switch (event) {
>     392         case SND_SOC_DAPM_POST_PMD:
>     393                 from = widget->on_val;
>     394                 to = widget->off_val;
>     395                 break;
>     396         case SND_SOC_DAPM_POST_PMU:
>     397                 from = widget->off_val;
>     398                 to = widget->on_val;
>     399                 break;
> 
> Smatch does a fairly naive analysis of the callers and thinks that
> event could be 1-2,4,8,16,32,64,128.

This should actually be safe as the widget that uses this
callback only registers for these two events, that said it is
probably nicer to have a default case anyway incase things change
later. I will fire out a patch shortly.

Thanks,
Charles

      reply	other threads:[~2025-05-27 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 10:04 [bug report] ASoC: SDCA: Create DAPM widgets and routes from DisCo Dan Carpenter
2025-05-27 14:43 ` Charles Keepax [this message]

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=aDXPhD09VI0jrvZQ@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.