]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: intel: avs: Fix type mismatch in variable assignment
authorsongxiebing <songxiebing@kylinos.cn>
Wed, 25 Mar 2026 02:17:52 +0000 (10:17 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 7 Apr 2026 11:33:19 +0000 (12:33 +0100)
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>
sound/soc/intel/avs/probes.c

index 74096236984a00dda39da2099cfbb25483895386..099119ad28b3cb22613535ddb12ea2d9676d0634 100644 (file)
@@ -144,7 +144,7 @@ static int avs_probe_compr_set_params(struct snd_compr_stream *cstream,
        ret = snd_compr_malloc_pages(cstream, rtd->buffer_size);
        if (ret < 0)
                return ret;
-       bps = snd_pcm_format_physical_width(params->codec.format);
+       bps = snd_pcm_format_physical_width((__force snd_pcm_format_t)params->codec.format);
        if (bps < 0)
                return bps;
        format_val = snd_hdac_stream_format(params->codec.ch_out, bps, params->codec.sample_rate);