[balbi-usb:testing/next 3/11] drivers/usb/gadget/udc/max3420_udc.c:570:16: sparse: sparse: incorrect type in assignment (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
head:   36d292c6ddd3248d5a8e465e51a4e3b76de93a91
commit: 0dac4567e8c4c4b3ba72d22ab6cd67267910d105 [3/11] usb: gadget: add udc driver for max3420
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout 0dac4567e8c4c4b3ba72d22ab6cd67267910d105
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

   drivers/usb/gadget/udc/max3420_udc.c:555:41: sparse: sparse: restricted __le16 degrades to integer
   drivers/usb/gadget/udc/max3420_udc.c:556:31: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/udc/max3420_udc.c:570:16: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [assigned] [usertype] status @@    got  short [assigned] [usertype] status @@
   drivers/usb/gadget/udc/max3420_udc.c:570:16: sparse:    expected unsigned short [assigned] [usertype] status
   drivers/usb/gadget/udc/max3420_udc.c:570:16: sparse:    got restricted __le16 [usertype]
   drivers/usb/gadget/udc/max3420_udc.c:588:31: sparse: sparse: restricted __le16 degrades to integer
   drivers/usb/gadget/udc/max3420_udc.c:602:32: sparse: sparse: restricted __le16 degrades to integer
   drivers/usb/gadget/udc/max3420_udc.c:631:29: sparse: sparse: cast from restricted __le16
   drivers/usb/gadget/udc/max3420_udc.c:632:29: sparse: sparse: cast from restricted __le16
   drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: sparse: cast from restricted __le16

vim +570 drivers/usb/gadget/udc/max3420_udc.c

   538	
   539	static void max3420_getstatus(struct max3420_udc *udc)
   540	{
   541		struct max3420_ep *ep;
   542		u16 status = 0;
   543	
   544		switch (udc->setup.bRequestType & USB_RECIP_MASK) {
   545		case USB_RECIP_DEVICE:
   546			/* Get device status */
   547			status = udc->gadget.is_selfpowered << USB_DEVICE_SELF_POWERED;
   548			status |= (udc->remote_wkp << USB_DEVICE_REMOTE_WAKEUP);
   549			break;
   550		case USB_RECIP_INTERFACE:
   551			if (udc->driver->setup(&udc->gadget, &udc->setup) < 0)
   552				goto stall;
   553			break;
   554		case USB_RECIP_ENDPOINT:
   555			ep = &udc->ep[udc->setup.wIndex & USB_ENDPOINT_NUMBER_MASK];
   556			if (udc->setup.wIndex & USB_DIR_IN) {
   557				if (!ep->ep_usb.caps.dir_in)
   558					goto stall;
   559			} else {
   560				if (!ep->ep_usb.caps.dir_out)
   561					goto stall;
   562			}
   563			if (ep->halted)
   564				status = 1 << USB_ENDPOINT_HALT;
   565			break;
   566		default:
   567			goto stall;
   568		}
   569	
 > 570		status = cpu_to_le16(status);
   571		spi_wr_buf(udc, MAX3420_REG_EP0FIFO, &status, 2);
   572		spi_wr8_ack(udc, MAX3420_REG_EP0BC, 2, 1);
   573		return;
   574	stall:
   575		dev_err(udc->dev, "Can't respond to getstatus request\n");
   576		spi_wr8(udc, MAX3420_REG_EPSTALLS, STLEP0IN | STLEP0OUT | STLSTAT);
   577	}
   578	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux