mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASOC: avs: Fix a sparse warnings for incorrect type in argument
@ 2026-03-23  3:27 songxiebing
  2026-03-25  2:17 ` [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment songxiebing
  0 siblings, 1 reply; 4+ messages in thread
From: songxiebing @ 2026-03-23  3:27 UTC (permalink / raw)
  To: tiwai; +Cc: linux-sound, linux-kernel, songxiebing, kernel test robot

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/
---
 sound/soc/intel/avs/probes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index 74096236984a..099119ad28b3 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment
  2026-03-23  3:27 [PATCH] ASOC: avs: Fix a sparse warnings for incorrect type in argument songxiebing
@ 2026-03-25  2:17 ` songxiebing
  2026-04-07 11:34   ` Mark Brown
  2026-04-07 19:12   ` Cezary Rojewski
  0 siblings, 2 replies; 4+ messages in thread
From: songxiebing @ 2026-03-25  2:17 UTC (permalink / raw)
  To: tiwai, broonie, cezary.rojewski
  Cc: linux-sound, linux-kernel, songxiebing, kernel test robot

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/
---
v2:
 - Modify title description
---
 sound/soc/intel/avs/probes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index 74096236984a..099119ad28b3 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment
  2026-03-25  2:17 ` [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment songxiebing
@ 2026-04-07 11:34   ` Mark Brown
  2026-04-07 19:12   ` Cezary Rojewski
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-04-07 11:34 UTC (permalink / raw)
  To: tiwai, cezary.rojewski, songxiebing
  Cc: linux-sound, linux-kernel, kernel test robot

On Wed, 25 Mar 2026 10:17:52 +0800, songxiebing wrote:
> ASoC: intel: avs: Fix type mismatch in variable assignment

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/1] ASoC: intel: avs: Fix type mismatch in variable assignment
      https://git.kernel.org/broonie/sound/c/fd495be8aa19

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment
  2026-03-25  2:17 ` [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment songxiebing
  2026-04-07 11:34   ` Mark Brown
@ 2026-04-07 19:12   ` Cezary Rojewski
  1 sibling, 0 replies; 4+ messages in thread
From: Cezary Rojewski @ 2026-04-07 19:12 UTC (permalink / raw)
  To: songxiebing; +Cc: linux-sound, linux-kernel, kernel test robot, tiwai, broonie

On 2026-03-25 3:17 AM, songxiebing wrote:
> 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/

While I see that this just got merged, the signed-off tag shall be the 
last. Other than that, looks good.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-07 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-23  3:27 [PATCH] ASOC: avs: Fix a sparse warnings for incorrect type in argument songxiebing
2026-03-25  2:17 ` [PATCH v2] ASoC: intel: avs: Fix type mismatch in variable assignment songxiebing
2026-04-07 11:34   ` Mark Brown
2026-04-07 19:12   ` Cezary Rojewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome