* [bug report] ASoC: atmel: mchp-pdmc: add PDMC driver
@ 2022-03-10 14:49 Dan Carpenter
2022-03-10 15:09 ` Codrin.Ciubotariu
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-03-10 14:49 UTC (permalink / raw)
To: codrin.ciubotariu; +Cc: alsa-devel
Hello Codrin Ciubotariu,
The patch 50291652af52: "ASoC: atmel: mchp-pdmc: add PDMC driver"
from Mar 7, 2022, leads to the following Smatch static checker
warning:
sound/soc/atmel/mchp-pdmc.c:186 mchp_pdmc_af_put()
warn: this array is probably non-NULL. 'uvalue->value.integer.value'
sound/soc/atmel/mchp-pdmc.c
181 static int mchp_pdmc_af_put(struct snd_kcontrol *kcontrol,
182 struct snd_ctl_elem_value *uvalue)
183 {
184 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
185 struct mchp_pdmc *dd = snd_soc_component_get_drvdata(component);
--> 186 bool af = uvalue->value.integer.value ? true : false;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
value is an array, not a pointer. It's always going to be non-NULL.
187
188 if (dd->audio_filter_en == af)
189 return 0;
190
191 dd->audio_filter_en = af;
192
193 return 1;
194 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] ASoC: atmel: mchp-pdmc: add PDMC driver
2022-03-10 14:49 [bug report] ASoC: atmel: mchp-pdmc: add PDMC driver Dan Carpenter
@ 2022-03-10 15:09 ` Codrin.Ciubotariu
0 siblings, 0 replies; 2+ messages in thread
From: Codrin.Ciubotariu @ 2022-03-10 15:09 UTC (permalink / raw)
To: dan.carpenter; +Cc: alsa-devel
On 10.03.2022 16:49, Dan Carpenter wrote:
> Hello Codrin Ciubotariu,
Hi Dan,
>
> The patch 50291652af52: "ASoC: atmel: mchp-pdmc: add PDMC driver"
> from Mar 7, 2022, leads to the following Smatch static checker
> warning:
>
> sound/soc/atmel/mchp-pdmc.c:186 mchp_pdmc_af_put()
> warn: this array is probably non-NULL. 'uvalue->value.integer.value'
>
> sound/soc/atmel/mchp-pdmc.c
> 181 static int mchp_pdmc_af_put(struct snd_kcontrol *kcontrol,
> 182 struct snd_ctl_elem_value *uvalue)
> 183 {
> 184 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
> 185 struct mchp_pdmc *dd = snd_soc_component_get_drvdata(component);
> --> 186 bool af = uvalue->value.integer.value ? true : false;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> value is an array, not a pointer. It's always going to be non-NULL.
Indeed. There is already a patch that addresses this [1]. Thank you for
your report!
Best regards,
Codrin
[1] https://lkml.org/lkml/2022/3/9/63
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-10 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10 14:49 [bug report] ASoC: atmel: mchp-pdmc: add PDMC driver Dan Carpenter
2022-03-10 15:09 ` Codrin.Ciubotariu
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.