Skip to content

Commit 1a9bbcc

Browse files
tndavedavem330
authored andcommitted
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: Tushar Dave <tushar.n.dave@oracle.com> Reviewed-by: chris hyser <chris.hyser@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 266439c commit 1a9bbcc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/net/ethernet/sun/sunbmac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq)
623623
void __iomem *gregs = bp->gregs;
624624
void __iomem *cregs = bp->creg;
625625
void __iomem *bregs = bp->bregs;
626+
__u32 bblk_dvma = (__u32)bp->bblock_dvma;
626627
unsigned char *e = &bp->dev->dev_addr[0];
627628

628629
/* Latch current counters into statistics. */
@@ -671,9 +672,9 @@ static int bigmac_init_hw(struct bigmac *bp, int from_irq)
671672
bregs + BMAC_XIFCFG);
672673

673674
/* Tell the QEC where the ring descriptors are. */
674-
sbus_writel(bp->bblock_dvma + bib_offset(be_rxd, 0),
675+
sbus_writel(bblk_dvma + bib_offset(be_rxd, 0),
675676
cregs + CREG_RXDS);
676-
sbus_writel(bp->bblock_dvma + bib_offset(be_txd, 0),
677+
sbus_writel(bblk_dvma + bib_offset(be_txd, 0),
677678
cregs + CREG_TXDS);
678679

679680
/* Setup the FIFO pointers into QEC local memory. */

drivers/net/ethernet/sun/sunbmac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ struct bigmac {
291291
void __iomem *bregs; /* BigMAC Registers */
292292
void __iomem *tregs; /* BigMAC Transceiver */
293293
struct bmac_init_block *bmac_block; /* RX and TX descriptors */
294-
__u32 bblock_dvma; /* RX and TX descriptors */
294+
dma_addr_t bblock_dvma; /* RX and TX descriptors */
295295

296296
spinlock_t lock;
297297

0 commit comments

Comments
 (0)