Skip to contentSkip to conversation

sound/usb/qcom/qc_audio_offload.c:943:27: sparse: sparse: incorrect type in argument 2 (different base types)

DISCUSSION kernel test robot 1 participant 1 message Apr 7

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   591cd656a1bf5ea94a222af5ef2ee76df029c1d2
commit: 326bbc348298ab0946c5560defe024a5f6ef28bb ALSA: usb-audio: qcom: Introduce QC USB SND offloading support
date:   12 months ago
config: hexagon-randconfig-r134-20260406 (https://download.01.org/0day-ci/archive/20260406/[email protected]/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c80443cd37b2e2788cba67ffa180a6331e5f0791)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260406/[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

| Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> sound/usb/qcom/qc_audio_offload.c:943:27: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned int val @@     got restricted snd_pcm_format_t [usertype] pcm_format @@

sound/usb/qcom/qc_audio_offload.c:943:27: sparse: expected unsigned int val
sound/usb/qcom/qc_audio_offload.c:943:27: sparse: got restricted snd_pcm_format_t [usertype] pcm_format

vim +943 sound/usb/qcom/qc_audio_offload.c

912
913 /**
914 * enable_audio_stream() - enable usb snd endpoints
915 * @subs: usb substream
916 * @pcm_format: pcm format requested
917 * @channels: number of channels
918 * @cur_rate: sample rate
919 * @datainterval: interval
920 *
921 * Opens all USB SND endpoints used for the data interface. This will increment
922 * the USB SND endpoint's opened count. Requests to keep the interface resumed
923 * until the audio stream is stopped. Will issue the USB set interface control
924 * message to enable the data interface.
925 *
926 */
927 static int enable_audio_stream(struct snd_usb_substream *subs,

   928				       snd_pcm_format_t pcm_format,
   929				       unsigned int channels, unsigned int cur_rate,
   930				       int datainterval)
   931	{
   932		struct snd_pcm_hw_params params;
   933		struct snd_usb_audio *chip;
   934		struct snd_interval *i;
   935		struct snd_mask *m;
   936		int ret;
   937	
   938		chip = subs->stream->chip;
   939	
   940		_snd_pcm_hw_params_any(&params);
   941	
   942		m = hw_param_mask(&params, SNDRV_PCM_HW_PARAM_FORMAT);
 > 943		snd_mask_leave(m, pcm_format);

944
945 i = hw_param_interval(&params, SNDRV_PCM_HW_PARAM_CHANNELS);
946 snd_interval_setinteger(i);
947 i->min = channels;
948 i->max = channels;
949
950 i = hw_param_interval(&params, SNDRV_PCM_HW_PARAM_RATE);
951 snd_interval_setinteger(i);
952 i->min = cur_rate;
953 i->max = cur_rate;
954
955 pm_runtime_barrier(&chip->intf[0]->dev);
956 snd_usb_autoresume(chip);
957
958 ret = snd_usb_hw_params(subs, &params);
959 if (ret < 0)
960 goto put_suspend;
961
962 if (!atomic_read(&chip->shutdown)) {
963 ret = snd_usb_lock_shutdown(chip);
964 if (ret < 0)
965 goto detach_ep;
966
967 if (subs->sync_endpoint) {
968 ret = snd_usb_endpoint_prepare(chip, subs->sync_endpoint);
969 if (ret < 0)
970 goto unlock;
971 }
972
973 ret = snd_usb_endpoint_prepare(chip, subs->data_endpoint);
974 if (ret < 0)
975 goto unlock;
976
977 snd_usb_unlock_shutdown(chip);
978
979 dev_dbg(uaudio_qdev->data->dev,
980 "selected %s iface:%d altsetting:%d datainterval:%dus\n",
981 subs->direction ? "capture" : "playback",
982 subs->cur_audiofmt->iface, subs->cur_audiofmt->altsetting,
983 (1 << subs->cur_audiofmt->datainterval) *
984 (subs->dev->speed >= USB_SPEED_HIGH ?
985 BUS_INTERVAL_HIGHSPEED_AND_ABOVE :
986 BUS_INTERVAL_FULL_SPEED));
987 }
988
989 return 0;
990
991 unlock:
992 snd_usb_unlock_shutdown(chip);
993
994 detach_ep:
995 snd_usb_hw_free(subs);
996
997 put_suspend:
998 snd_usb_autosuspend(chip);
999
1000 return ret;
1001 }
1002

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