diff options
author | Pawel Laszczak <pawell@cadence.com> | 2020-12-14 13:03:44 +0100 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2020-12-29 12:36:13 +0800 |
commit | 16e3610154d0c992a0558d684213201f5355bd76 (patch) | |
tree | 208965307f82a96acd770c0a09ff07ad5fb197b3 /drivers/usb/cdns3/cdnsp-mem.c | |
parent | fba8701baed76eac00b84b59f09f6a077f24c534 (diff) | |
download | linux-16e3610154d0c992a0558d684213201f5355bd76.tar.gz linux-16e3610154d0c992a0558d684213201f5355bd76.tar.bz2 linux-16e3610154d0c992a0558d684213201f5355bd76.zip |
usb: cdnsp: Fixes for sparse warnings
Patch fixes all sparse warnings in cdsnp driver.
It fixes the following warnings:
cdnsp-ring.c:1441: warning: incorrect type in assignment
cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
cdnsp-ring.c:2200: warning: dubious: x | !y
cdnsp-gadget.c:501: warning: incorrect type in assignment
cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:509: warning: invalid assignment: |=
cdnsp-gadget.c:510: warning: cast from restricted __le32
cdnsp-gadget.c:558: warning: incorrect type in assignment
cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:1571: warning: incorrect type in argument 1
cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
cdnsp-gadget.c:1760: warning: incorrect type in assignment
cdnsp-gadget.c:1762: warning: incorrect type in assignment
cdnsp-gadget.c:1763: warning: incorrect type in assignment
cdnsp-gadget.c:1764: warning: incorrect type in assignment
cdnsp-gadget.c:1765: warning: incorrect type in assignment
cdnsp-gadget.c:1766: warning: incorrect type in assignment
cdnsp-gadget.c:1767: warning: incorrect type in assignment
cdnsp-gadget.c:458: warning: cast truncates bits from constant value
(ffffffff07ffffff becomes 7ffffff)
cdnsp-gadget.c:666: warning: cast truncates bits from constant value
(ffffffff07ffffff becomes 7ffffff)
cdnsp-mem.c:762: warning: incorrect type in assignment
cdnsp-mem.c:763: warning: incorrect type in assignment
cdnsp-mem.c:928: warning: cast from restricted __le16
cdnsp-mem.c:1187: warning: incorrect type in assignment
cdnsp-mem.c:1191: warning: incorrect type in assignment
cdnsp-ep0.c:142: warning: incorrect type in assignment
cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
cdnsp-ep0.c:179: warning: incorrect type in argument 1
cdnsp-ep0.c:311: warning: incorrect type in argument 1
cdnsp-ep0.c:469: warning: incorrect type in assignment
cdnsp-trace.h:611:1: warning: cast from restricted __le32
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/cdns3/cdnsp-mem.c')
-rw-r--r-- | drivers/usb/cdns3/cdnsp-mem.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c index 4c7d77fb097e..7a84e928710e 100644 --- a/drivers/usb/cdns3/cdnsp-mem.c +++ b/drivers/usb/cdns3/cdnsp-mem.c @@ -759,8 +759,9 @@ int cdnsp_setup_addressable_priv_dev(struct cdnsp_device *pdev) port = DEV_PORT(pdev->active_port->port_num); slot_ctx->dev_port |= cpu_to_le32(port); - slot_ctx->dev_state = (pdev->device_address & DEV_ADDR_MASK); - ep0_ctx->tx_info = EP_AVG_TRB_LENGTH(0x8); + slot_ctx->dev_state = cpu_to_le32((pdev->device_address & + DEV_ADDR_MASK)); + ep0_ctx->tx_info = cpu_to_le32(EP_AVG_TRB_LENGTH(0x8)); ep0_ctx->ep_info2 = cpu_to_le32(EP_TYPE(CTRL_EP)); ep0_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(0) | ERROR_COUNT(3) | max_packets); @@ -925,7 +926,7 @@ static u32 cdnsp_get_max_esit_payload(struct usb_gadget *g, /* SuperSpeedPlus Isoc ep sending over 48k per EIST. */ if (g->speed >= USB_SPEED_SUPER_PLUS && USB_SS_SSP_ISOC_COMP(pep->endpoint.desc->bmAttributes)) - return le32_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); + return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); /* SuperSpeed or SuperSpeedPlus Isoc ep with less than 48k per esit */ else if (g->speed >= USB_SPEED_SUPER) return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); @@ -1184,11 +1185,11 @@ static int cdnsp_setup_port_arrays(struct cdnsp_device *pdev) trace_cdnsp_init("Found USB 2.0 ports and USB 3.0 ports."); - pdev->usb2_port.regs = (struct cdnsp_port_regs *) + pdev->usb2_port.regs = (struct cdnsp_port_regs __iomem *) (&pdev->op_regs->port_reg_base + NUM_PORT_REGS * (pdev->usb2_port.port_num - 1)); - pdev->usb3_port.regs = (struct cdnsp_port_regs *) + pdev->usb3_port.regs = (struct cdnsp_port_regs __iomem *) (&pdev->op_regs->port_reg_base + NUM_PORT_REGS * (pdev->usb3_port.port_num - 1)); |