Commit 5831b7b4 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: net2280 compile fixes

Fix some compiler warnings that came up with net2280 on processors with
64bit dma_addr-t ... one of them would have been a bug on big-endian CPUs.
(Thanks to Randy Dunlap for reporting these.)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 14f651a8
...@@ -717,7 +717,7 @@ fill_dma_desc (struct net2280_ep *ep, struct net2280_request *req, int valid) ...@@ -717,7 +717,7 @@ fill_dma_desc (struct net2280_ep *ep, struct net2280_request *req, int valid)
dmacount |= (1 << DMA_DONE_INTERRUPT_ENABLE); dmacount |= (1 << DMA_DONE_INTERRUPT_ENABLE);
/* td->dmadesc = previously set by caller */ /* td->dmadesc = previously set by caller */
td->dmaaddr = cpu_to_le32p (&req->req.dma); td->dmaaddr = cpu_to_le32 (req->req.dma);
/* 2280 may be polling VALID_BIT through ep->dma->dmadesc */ /* 2280 may be polling VALID_BIT through ep->dma->dmadesc */
wmb (); wmb ();
...@@ -1707,8 +1707,10 @@ show_queues (struct device *_dev, char *buf) ...@@ -1707,8 +1707,10 @@ show_queues (struct device *_dev, char *buf)
td = req->td; td = req->td;
t = scnprintf (next, size, "\t td %08x " t = scnprintf (next, size, "\t td %08x "
" count %08x buf %08x desc %08x\n", " count %08x buf %08x desc %08x\n",
req->td_dma, td->dmacount, (u32) req->td_dma,
td->dmaaddr, td->dmadesc); le32_to_cpu (td->dmacount),
le32_to_cpu (td->dmaaddr),
le32_to_cpu (td->dmadesc));
if (t <= 0 || t > size) if (t <= 0 || t > size)
goto done; goto done;
size -= t; size -= t;
...@@ -2845,6 +2847,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2845,6 +2847,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
dev->got_irq = 1; dev->got_irq = 1;
/* DMA setup */ /* DMA setup */
/* NOTE: we know only the 32 LSBs of dma addresses may be nonzero */
dev->requests = pci_pool_create ("requests", pdev, dev->requests = pci_pool_create ("requests", pdev,
sizeof (struct net2280_dma), sizeof (struct net2280_dma),
0 /* no alignment requirements */, 0 /* no alignment requirements */,
......
...@@ -495,10 +495,10 @@ set_idx_reg (struct net2280_regs __iomem *regs, u32 index, u32 value) ...@@ -495,10 +495,10 @@ set_idx_reg (struct net2280_regs __iomem *regs, u32 index, u32 value)
* use struct net2280_dma_regs bitfields * use struct net2280_dma_regs bitfields
*/ */
struct net2280_dma { struct net2280_dma {
u32 dmacount; __le32 dmacount;
u32 dmaaddr; /* the buffer */ __le32 dmaaddr; /* the buffer */
u32 dmadesc; /* next dma descriptor */ __le32 dmadesc; /* next dma descriptor */
u32 _reserved; __le32 _reserved;
} __attribute__ ((aligned (16))); } __attribute__ ((aligned (16)));
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment