mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nagarjuna Kristam <nkristam@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Felipe Balbi <felipe.balbi@linux.intel.com>
Subject: drivers/usb/gadget/udc/tegra-xudc.c:2257:26: sparse: sparse: incorrect type in assignment (different base types)
Date: Sun, 30 Aug 2020 15:10:37 +0800	[thread overview]
Message-ID: <202008301536.7FGV6Bxg%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4670 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1127b219ce9481c84edad9711626d856127d5e51
commit: 49db427232fe2c357d23a2d62e2db1d431f95051 usb: gadget: Add UDC driver for tegra XUSB device mode controller
date:   10 months ago
config: arm64-randconfig-s031-20200830 (attached as .config)
compiler: aarch64-linux-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.2-191-g10164920-dirty
        git checkout 49db427232fe2c357d23a2d62e2db1d431f95051
        # 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=arm64 

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


sparse warnings: (new ones prefixed by >>)

   drivers/usb/gadget/udc/tegra-xudc.c:611:9: sparse: sparse: undefined identifier 'tegra_xusb_padctl_set_vbus_override'
   drivers/usb/gadget/udc/tegra-xudc.c:628:9: sparse: sparse: undefined identifier 'tegra_xusb_padctl_set_vbus_override'
   drivers/usb/gadget/udc/tegra-xudc.c:711:25: sparse: sparse: undefined identifier 'tegra_xusb_padctl_set_vbus_override'
   drivers/usb/gadget/udc/tegra-xudc.c:713:25: sparse: sparse: undefined identifier 'tegra_xusb_padctl_set_vbus_override'
   drivers/usb/gadget/udc/tegra-xudc.c:741:31: sparse: sparse: undefined identifier 'tegra_phy_xusb_utmi_port_reset'
>> drivers/usb/gadget/udc/tegra-xudc.c:2257:26: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] status_buf @@     got restricted __le16 [usertype] @@
>> drivers/usb/gadget/udc/tegra-xudc.c:2257:26: sparse:     expected unsigned short [usertype] status_buf
>> drivers/usb/gadget/udc/tegra-xudc.c:2257:26: sparse:     got restricted __le16 [usertype]

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=49db427232fe2c357d23a2d62e2db1d431f95051
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 49db427232fe2c357d23a2d62e2db1d431f95051
vim +2257 drivers/usb/gadget/udc/tegra-xudc.c

  2197	
  2198	static int tegra_xudc_ep0_get_status(struct tegra_xudc *xudc,
  2199					     struct usb_ctrlrequest *ctrl)
  2200	{
  2201		struct tegra_xudc_ep_context *ep_ctx;
  2202		u32 val, ep, index = le16_to_cpu(ctrl->wIndex);
  2203		u16 status = 0;
  2204	
  2205		if (!(ctrl->bRequestType & USB_DIR_IN))
  2206			return -EINVAL;
  2207	
  2208		if ((le16_to_cpu(ctrl->wValue) != 0) ||
  2209		    (le16_to_cpu(ctrl->wLength) != 2))
  2210			return -EINVAL;
  2211	
  2212		switch (ctrl->bRequestType & USB_RECIP_MASK) {
  2213		case USB_RECIP_DEVICE:
  2214			val = xudc_readl(xudc, PORTPM);
  2215	
  2216			if (xudc->selfpowered)
  2217				status |= BIT(USB_DEVICE_SELF_POWERED);
  2218	
  2219			if ((xudc->gadget.speed < USB_SPEED_SUPER) &&
  2220			    (val & PORTPM_RWE))
  2221				status |= BIT(USB_DEVICE_REMOTE_WAKEUP);
  2222	
  2223			if (xudc->gadget.speed == USB_SPEED_SUPER) {
  2224				if (val & PORTPM_U1E)
  2225					status |= BIT(USB_DEV_STAT_U1_ENABLED);
  2226				if (val & PORTPM_U2E)
  2227					status |= BIT(USB_DEV_STAT_U2_ENABLED);
  2228			}
  2229			break;
  2230		case USB_RECIP_INTERFACE:
  2231			if (xudc->gadget.speed == USB_SPEED_SUPER) {
  2232				status |= USB_INTRF_STAT_FUNC_RW_CAP;
  2233				val = xudc_readl(xudc, PORTPM);
  2234				if (val & PORTPM_FRWE)
  2235					status |= USB_INTRF_STAT_FUNC_RW;
  2236			}
  2237			break;
  2238		case USB_RECIP_ENDPOINT:
  2239			ep = (index & USB_ENDPOINT_NUMBER_MASK) * 2 +
  2240				((index & USB_DIR_IN) ? 1 : 0);
  2241			ep_ctx = &xudc->ep_context[ep];
  2242	
  2243			if ((xudc->device_state != USB_STATE_CONFIGURED) &&
  2244			    ((xudc->device_state != USB_STATE_ADDRESS) || (ep != 0)))
  2245				return -EINVAL;
  2246	
  2247			if (ep_ctx_read_state(ep_ctx) == EP_STATE_DISABLED)
  2248				return -EINVAL;
  2249	
  2250			if (xudc_readl(xudc, EP_HALT) & BIT(ep))
  2251				status |= BIT(USB_ENDPOINT_HALT);
  2252			break;
  2253		default:
  2254			return -EINVAL;
  2255		}
  2256	
> 2257		xudc->status_buf = cpu_to_le16(status);
  2258		return tegra_xudc_ep0_queue_data(xudc, &xudc->status_buf,
  2259						 sizeof(xudc->status_buf),
  2260						 no_op_complete);
  2261	}
  2262	

---
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: 33513 bytes --]

             reply	other threads:[~2020-08-30  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30  7:10 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-24  8:33 kernel test robot

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=202008301536.7FGV6Bxg%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nkristam@nvidia.com \
    /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®