Commit 1a9bbcca authored by Tushar Dave's avatar Tushar Dave Committed by David S. Miller

sunbmac: Fix compiler warning

sunbmac uses '__u32' for dma handle while invoking kernel DMA APIs,
instead of using dma_addr_t. This hasn't caused any 'incompatible
pointer type' warning on SPARC because until now dma_addr_t is of
type u32. However, recent changes in SPARC ATU (iommu) enables 64bit
DMA and therefore dma_addr_t becomes of type u64. This makes
'incompatible pointer type' warnings inevitable.

e.g.
drivers/net/ethernet/sun/sunbmac.c: In function ‘bigmac_ether_init’:
drivers/net/ethernet/sun/sunbmac.c:1166: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type
./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’

This patch resolves above compiler warning.
Signed-off-by: default avatarTushar Dave <tushar.n.dave@oracle.com>
Reviewed-by: default avatarchris hyser <chris.hyser@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 266439c9
...@@ -623,6 +623,7 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq) ...@@ -623,6 +623,7 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq)
void __iomem *gregs = bp->gregs; void __iomem *gregs = bp->gregs;
void __iomem *cregs = bp->creg; void __iomem *cregs = bp->creg;
void __iomem *bregs = bp->bregs; void __iomem *bregs = bp->bregs;
__u32 bblk_dvma = (__u32)bp->bblock_dvma;
unsigned char *e = &bp->dev->dev_addr[0]; unsigned char *e = &bp->dev->dev_addr[0];
/* Latch current counters into statistics. */ /* Latch current counters into statistics. */
...@@ -671,9 +672,9 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq) ...@@ -671,9 +672,9 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq)
bregs + BMAC_XIFCFG); bregs + BMAC_XIFCFG);
/* Tell the QEC where the ring descriptors are. */ /* Tell the QEC where the ring descriptors are. */
sbus_writel(bp->bblock_dvma + bib_offset(be_rxd, 0), sbus_writel(bblk_dvma + bib_offset(be_rxd, 0),
cregs + CREG_RXDS); cregs + CREG_RXDS);
sbus_writel(bp->bblock_dvma + bib_offset(be_txd, 0), sbus_writel(bblk_dvma + bib_offset(be_txd, 0),
cregs + CREG_TXDS); cregs + CREG_TXDS);
/* Setup the FIFO pointers into QEC local memory. */ /* Setup the FIFO pointers into QEC local memory. */
......
...@@ -291,7 +291,7 @@ struct bigmac { ...@@ -291,7 +291,7 @@ struct bigmac {
void __iomem *bregs; /* BigMAC Registers */ void __iomem *bregs; /* BigMAC Registers */
void __iomem *tregs; /* BigMAC Transceiver */ void __iomem *tregs; /* BigMAC Transceiver */
struct bmac_init_block *bmac_block; /* RX and TX descriptors */ struct bmac_init_block *bmac_block; /* RX and TX descriptors */
__u32 bblock_dvma; /* RX and TX descriptors */ dma_addr_t bblock_dvma; /* RX and TX descriptors */
spinlock_t lock; spinlock_t lock;
......
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