[alsa-devel] [asoc:for-5.5 122/122] sound/soc/codecs/tas2562.c:195:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer

Takashi Iwai tiwai at suse.de
Tue Oct 22 07:08:16 CEST 2019


On Mon, 21 Oct 2019 21:19:13 +0200,
Mark Brown wrote:
> 
> On Fri, Oct 11, 2019 at 07:13:38AM -0500, Dan Murphy wrote:
> > On 10/10/19 11:41 AM, kbuild test robot wrote:
> 
> > >     190	static int tas2562_set_bitwidth(struct tas2562_data *tas2562, int bitwidth)
> 
> > The only fix I can see here is to change bitwidth to snd_pcm_format_t as
> 
> > But that still gives this sparse warning.  The way the code below is
> > written  to be consistent throughout the drivers so are these warnings false
> > positives?
> 
> I think so, yes.  Or at least I can't see any sensible way to stop this
> anyway.

You can pass the real bit width (16, 24, 32) via
snd_pcm_format_width().

BTW, the error message after tas2562_set_samplerate() seems bogus,
still indicating the bitwidth instead of the rate.


thanks,

Takashi


More information about the Alsa-devel mailing list