summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdnsp-gadget.c
diff options
context:
space:
mode:
authorPawel Laszczak <pawell@cadence.com>2020-12-14 13:03:44 +0100
committerPeter Chen <peter.chen@nxp.com>2020-12-29 12:36:13 +0800
commit16e3610154d0c992a0558d684213201f5355bd76 (patch)
tree208965307f82a96acd770c0a09ff07ad5fb197b3 /drivers/usb/cdns3/cdnsp-gadget.c
parentfba8701baed76eac00b84b59f09f6a077f24c534 (diff)
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-gadget.c')
-rw-r--r--drivers/usb/cdns3/cdnsp-gadget.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index 1668f72fdf30..f28f1508f049 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -491,7 +491,7 @@ static void cdnsp_invalidate_ep_events(struct cdnsp_device *pdev,
struct cdnsp_segment *segment;
union cdnsp_trb *event;
u32 cycle_state;
- __le32 data;
+ u32 data;
event = pdev->event_ring->dequeue;
segment = pdev->event_ring->deq_seg;
@@ -527,9 +527,9 @@ int cdnsp_wait_for_cmd_compl(struct cdnsp_device *pdev)
dma_addr_t cmd_deq_dma;
union cdnsp_trb *event;
u32 cycle_state;
- __le32 flags;
int ret, val;
u64 cmd_dma;
+ u32 flags;
cmd_trb = pdev->cmd.command_trb;
pdev->cmd.status = 0;
@@ -1568,7 +1568,7 @@ static void cdnsp_get_ep_buffering(struct cdnsp_device *pdev,
return;
}
- endpoints = HCS_ENDPOINTS(readl(&pdev->hcs_params1)) / 2;
+ endpoints = HCS_ENDPOINTS(pdev->hcs_params1) / 2;
/* Set to XBUF_TX_TAG_MASK_0 register. */
reg += XBUF_TX_CMD_OFFSET + (endpoints * 2 + 2) * sizeof(u32);
@@ -1754,22 +1754,16 @@ void cdnsp_irq_reset(struct cdnsp_device *pdev)
static void cdnsp_get_rev_cap(struct cdnsp_device *pdev)
{
void __iomem *reg = &pdev->cap_regs->hc_capbase;
- struct cdnsp_rev_cap *rev_cap;
reg += cdnsp_find_next_ext_cap(reg, 0, RTL_REV_CAP);
- rev_cap = reg;
-
- pdev->rev_cap.ctrl_revision = readl(&rev_cap->ctrl_revision);
- pdev->rev_cap.rtl_revision = readl(&rev_cap->rtl_revision);
- pdev->rev_cap.ep_supported = readl(&rev_cap->ep_supported);
- pdev->rev_cap.ext_cap = readl(&rev_cap->ext_cap);
- pdev->rev_cap.rx_buff_size = readl(&rev_cap->rx_buff_size);
- pdev->rev_cap.tx_buff_size = readl(&rev_cap->tx_buff_size);
+ pdev->rev_cap = reg;
dev_info(pdev->dev, "Rev: %08x/%08x, eps: %08x, buff: %08x/%08x\n",
- pdev->rev_cap.ctrl_revision, pdev->rev_cap.rtl_revision,
- pdev->rev_cap.ep_supported, pdev->rev_cap.rx_buff_size,
- pdev->rev_cap.tx_buff_size);
+ readl(&pdev->rev_cap->ctrl_revision),
+ readl(&pdev->rev_cap->rtl_revision),
+ readl(&pdev->rev_cap->ep_supported),
+ readl(&pdev->rev_cap->rx_buff_size),
+ readl(&pdev->rev_cap->tx_buff_size));
}
static int cdnsp_gen_setup(struct cdnsp_device *pdev)