From: kbuild test robot <lkp@intel.com>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Felipe Balbi <balbi@kernel.org>
Subject: drivers/usb/gadget/udc/max3420_udc.c:631:29: sparse: sparse: incorrect type in argument 1 (different base types)
Date: Wed, 27 May 2020 18:51:17 +0800 [thread overview]
Message-ID: <202005271811.E9HZUWEf%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5665 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 444fc5cde64330661bf59944c43844e7d4c2ccd8
commit: 48ba02b2e2b1a1c80718e93fefe99c8319597c4a usb: gadget: add udc driver for max3420
date: 2 months ago
config: sparc64-randconfig-s031-20200527 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
git checkout 48ba02b2e2b1a1c80718e93fefe99c8319597c4a
# save the attached .config to linux build tree
make W=1 C=1 ARCH=sparc64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
./arch/sparc/include/generated/uapi/asm/unistd_64.h:379:40: sparse: sparse: no newline at end of file
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 restricted __le16 [usertype] @@
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:631:29: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] val @@ got restricted __le16 [addressable] [usertype] wValue @@
drivers/usb/gadget/udc/max3420_udc.c:631:29: sparse: expected unsigned short [usertype] val
drivers/usb/gadget/udc/max3420_udc.c:631:29: sparse: got restricted __le16 [addressable] [usertype] wValue
drivers/usb/gadget/udc/max3420_udc.c:631:29: sparse: sparse: cast from restricted __le16
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:632:29: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] val @@ got restricted __le16 [addressable] [usertype] wIndex @@
drivers/usb/gadget/udc/max3420_udc.c:632:29: sparse: expected unsigned short [usertype] val
drivers/usb/gadget/udc/max3420_udc.c:632:29: sparse: got restricted __le16 [addressable] [usertype] wIndex
drivers/usb/gadget/udc/max3420_udc.c:632: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
>> drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] val @@ got restricted __le16 [addressable] [usertype] wLength @@
drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: expected unsigned short [usertype] val
drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: got restricted __le16 [addressable] [usertype] wLength
drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: sparse: cast from restricted __le16
drivers/usb/gadget/udc/max3420_udc.c:633:30: sparse: sparse: cast from restricted __le16
vim +631 drivers/usb/gadget/udc/max3420_udc.c
622
623 static void max3420_handle_setup(struct max3420_udc *udc)
624 {
625 struct usb_ctrlrequest setup;
626 u8 addr;
627
628 spi_rd_buf(udc, MAX3420_REG_SUDFIFO, (void *)&setup, 8);
629
630 udc->setup = setup;
> 631 udc->setup.wValue = cpu_to_le16(setup.wValue);
> 632 udc->setup.wIndex = cpu_to_le16(setup.wIndex);
> 633 udc->setup.wLength = cpu_to_le16(setup.wLength);
634
635 switch (udc->setup.bRequest) {
636 case USB_REQ_GET_STATUS:
637 /* Data+Status phase form udc */
638 if ((udc->setup.bRequestType &
639 (USB_DIR_IN | USB_TYPE_MASK)) !=
640 (USB_DIR_IN | USB_TYPE_STANDARD)) {
641 break;
642 }
643 return max3420_getstatus(udc);
644 case USB_REQ_SET_ADDRESS:
645 /* Status phase from udc */
646 if (udc->setup.bRequestType != (USB_DIR_OUT |
647 USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
648 break;
649 }
650 addr = spi_rd8_ack(udc, MAX3420_REG_FNADDR, 1);
651 dev_dbg(udc->dev, "Assigned Address=%d\n", udc->setup.wValue);
652 return;
653 case USB_REQ_CLEAR_FEATURE:
654 case USB_REQ_SET_FEATURE:
655 /* Requests with no data phase, status phase from udc */
656 if ((udc->setup.bRequestType & USB_TYPE_MASK)
657 != USB_TYPE_STANDARD)
658 break;
659 return max3420_set_clear_feature(udc);
660 default:
661 break;
662 }
663
664 if (udc->driver->setup(&udc->gadget, &setup) < 0) {
665 /* Stall EP0 */
666 spi_wr8(udc, MAX3420_REG_EPSTALLS,
667 STLEP0IN | STLEP0OUT | STLSTAT);
668 }
669 }
670
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33489 bytes --]
reply other threads:[~2020-05-27 10:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202005271811.E9HZUWEf%lkp@intel.com \
--to=lkp@intel.com \
--cc=balbi@kernel.org \
--cc=jaswinder.singh@linaro.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®