[thesofproject:topic/sof-dev 12/23] sound/soc/sof/intel/hda-pcm.c:173:66: sparse: sparse: incorrect type in argument 1 (different base types)

kernel test robot <[email protected]> Thu, 30 Jul 2026 17:54:13 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://github.com/thesofproject/linux topic/sof-dev
head:   15c9b701ada608fc3310f4bc2b3e48cbfec206d3
commit: 589b466c7e51c6929ec3196b362f1feccf32b411 [12/23] ASoC: SOF: ops: Add new platform-specific ops for compress
config: parisc-randconfig-r133-20260730 (https://download.01.org/0day-ci/archive/20260730/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 15.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260730/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> sound/soc/sof/intel/hda-pcm.c:173:66: 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/sof/intel/hda-pcm.c:173:66: sparse:     expected restricted snd_pcm_format_t [usertype] format
   sound/soc/sof/intel/hda-pcm.c:173:66: sparse:     got unsigned int [usertype] format

vim +173 sound/soc/sof/intel/hda-pcm.c

   153	
   154	int hda_dsp_compr_hw_params(struct snd_sof_dev *sdev,
   155				    struct snd_compr_stream *cstream,
   156				    struct snd_compr_params *params,
   157				    struct snd_sof_platform_stream_params *platform_params)
   158	{
   159		struct hdac_stream *hstream = cstream->runtime->private_data;
   160		struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream);
   161		struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
   162		struct snd_dma_buffer *dmab;
   163		u32 bits, rate;
   164		int bps;
   165		int ret;
   166	
   167		hstream->cstream = cstream;
   168		dmab = cstream->runtime->dma_buffer_p;
   169	
   170		/* Use correct format based on the used codec */
   171		switch (params->codec.id) {
   172		case SND_AUDIOCODEC_PCM:
 > 173			bps = snd_pcm_format_physical_width(params->codec.format);
   174			break;
   175		case SND_AUDIOCODEC_VORBIS:
   176			bps = snd_pcm_format_physical_width(SNDRV_PCM_FORMAT_S16_LE);
   177			break;
   178		case SND_AUDIOCODEC_FLAC:
   179		{
   180			struct snd_dec_flac *dec_flac = &params->codec.options.flac_d;
   181	
   182			if (dec_flac->sample_size == 16)
   183				bps = snd_pcm_format_physical_width(SNDRV_PCM_FORMAT_S16_LE);
   184			else
   185				bps = snd_pcm_format_physical_width(SNDRV_PCM_FORMAT_S32_LE);
   186			break;
   187		}
   188		default:
   189			bps = snd_pcm_format_physical_width(SNDRV_PCM_FORMAT_S32_LE);
   190		}
   191	
   192		if (bps < 0)
   193			return bps;
   194		bits = hda_dsp_get_bits(sdev, bps);
   195		rate = hda_dsp_get_mult_div(sdev, params->codec.sample_rate);
   196	
   197		hstream->format_val = rate | bits | (params->codec.ch_out - 1);
   198		hstream->bufsize = cstream->runtime->buffer_size;
   199		hstream->period_bytes = cstream->runtime->fragment_size;
   200		hstream->no_period_wakeup  = false;
   201	
   202		/* params is not used so pass NULL */
   203		dmab = cstream->runtime->dma_buffer_p;
   204		ret = hda_dsp_stream_hw_params(sdev, hext_stream, dmab, NULL);
   205		if (ret < 0) {
   206			dev_err(sdev->dev, "%s: hdac prepare failed: %d\n", __func__, ret);
   207			return ret;
   208		}
   209	
   210		if (hda)
   211			platform_params->no_ipc_position = hda->no_ipc_position;
   212	
   213		platform_params->stream_tag = hstream->stream_tag;
   214	
   215		return 0;
   216	}
   217	EXPORT_SYMBOL_NS(hda_dsp_compr_hw_params, "SND_SOC_SOF_INTEL_HDA_COMMON");
   218	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki