Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: intel: avs: Fix type mismatch in variable assignment

The input parameter requirement for snd_pcm_format_physical_with is
snd_pcm_format_t,but params->codec.format is __u32, resulting in a
mismatch error:

sparse warnings: (new ones prefixed by >>)
>> sound/soc/intel/avs/probes.c:147:58: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted snd_pcm_format_t [usertype] format @@ got unsigned int [usertype] format @@
sound/soc/intel/avs/probes.c:147:58: sparse: expected restricted snd_pcm_format_t [usertype] format
sound/soc/intel/avs/probes.c:147:58: sparse: got unsigned int [usertype] format

So here, the format is cast to snd_pcm_format_t.

Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512190032.hnwn9mCV-lkp@intel.com/
Link: https://patch.msgid.link/20260325021752.238203-1-songxiebing@kylinos.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

songxiebing and committed by
Mark Brown
fd495be8 d78ddeb8

+1 -1
+1 -1
sound/soc/intel/avs/probes.c
··· 144 144 ret = snd_compr_malloc_pages(cstream, rtd->buffer_size); 145 145 if (ret < 0) 146 146 return ret; 147 - bps = snd_pcm_format_physical_width(params->codec.format); 147 + bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format); 148 148 if (bps < 0) 149 149 return bps; 150 150 format_val = snd_hdac_stream_format(params->codec.ch_out, bps, params->codec.sample_rate);