[sound:test/usb-hacks 31/48] sound/usb/endpoint.c:504:33: sparse: sparse: incorrect type in assignment (different base types)

kernel test robot lkp at intel.com
Fri Nov 13 22:40:00 CET 2020


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git test/usb-hacks
head:   1f19fce1baf5f21347d1c9697ab9d48a5e25301f
commit: c95d75571aefae9a8c06940486cf066a893aceb3 [31/48] ALSA: usb-audio: Create endpoint objects at parsing phase
config: c6x-randconfig-s031-20201113 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-107-gaf3512a6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?id=c95d75571aefae9a8c06940486cf066a893aceb3
        git remote add sound https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
        git fetch --no-tags sound test/usb-hacks
        git checkout c95d75571aefae9a8c06940486cf066a893aceb3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=c6x 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> sound/usb/endpoint.c:504:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int syncmaxsize @@     got restricted __le16 [usertype] wMaxPacketSize @@
>> sound/usb/endpoint.c:504:33: sparse:     expected unsigned int syncmaxsize
>> sound/usb/endpoint.c:504:33: sparse:     got restricted __le16 [usertype] wMaxPacketSize

vim +504 sound/usb/endpoint.c

   458	
   459	#define ep_type_name(type) \
   460		(type == SND_USB_ENDPOINT_TYPE_DATA ? "data" : "sync")
   461	
   462	static int
   463	add_endpoint(struct snd_usb_audio *chip, int ep_num, int type,
   464		     struct usb_endpoint_descriptor *desc)
   465	{
   466		struct snd_usb_endpoint *ep;
   467		bool is_playback;
   468	
   469		ep = snd_usb_get_endpoint(chip, ep_num);
   470		if (ep)
   471			return 0;
   472	
   473		usb_audio_dbg(chip, "Creating new %s endpoint #%x\n",
   474			      ep_type_name(type),
   475			      ep_num);
   476		ep = kzalloc(sizeof(*ep), GFP_KERNEL);
   477		if (!ep)
   478			return -ENOMEM;
   479	
   480		ep->chip = chip;
   481		spin_lock_init(&ep->lock);
   482		ep->type = type;
   483		ep->ep_num = ep_num;
   484		INIT_LIST_HEAD(&ep->ready_playback_urbs);
   485	
   486		is_playback = ((ep_num & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
   487		ep_num &= USB_ENDPOINT_NUMBER_MASK;
   488		if (is_playback)
   489			ep->pipe = usb_sndisocpipe(chip->dev, ep_num);
   490		else
   491			ep->pipe = usb_rcvisocpipe(chip->dev, ep_num);
   492	
   493		if (type == SND_USB_ENDPOINT_TYPE_SYNC) {
   494			if (desc->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&
   495			    desc->bRefresh >= 1 && desc->bRefresh <= 9)
   496				ep->syncinterval = desc->bRefresh;
   497			else if (snd_usb_get_speed(chip->dev) == USB_SPEED_FULL)
   498				ep->syncinterval = 1;
   499			else if (desc->bInterval >= 1 && desc->bInterval <= 16)
   500				ep->syncinterval = desc->bInterval - 1;
   501			else
   502				ep->syncinterval = 3;
   503	
 > 504			ep->syncmaxsize = desc->wMaxPacketSize;
   505		}
   506	
   507		list_add_tail(&ep->list, &chip->ep_list);
   508		return 0;
   509	}
   510	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 21418 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20201114/2d052db7/attachment-0001.gz>


More information about the Alsa-devel mailing list