[U-Boot] [PATCH] MIPS: Fix compile warning in au1x00_eth.c

Stefan Roese sr at denx.de
Wed Jan 28 06:44:23 CET 2009


This patch fixes this compilation warning:

./MAKEALL dbau1000
Configuring for dbau1x00 board...
au1x00_eth.c: In function 'au1x00_send':
au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards
	qualifiers from pointer target type
...

Seens with ELDK 4.2 (GCC 4.2.2).

Signed-off-by: Stefan Roese <sr at denx.de>
---
 cpu/mips/au1x00_eth.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cpu/mips/au1x00_eth.c b/cpu/mips/au1x00_eth.c
index 6272a3a..5546800 100644
--- a/cpu/mips/au1x00_eth.c
+++ b/cpu/mips/au1x00_eth.c
@@ -155,7 +155,7 @@ static int au1x00_send(struct eth_device* dev, volatile void *packet, int length
 
 	/* tx fifo should always be idle */
 	fifo_tx[next_tx].len = length;
-	fifo_tx[next_tx].addr = (virt_to_phys(packet))|TX_DMA_ENABLE;
+	fifo_tx[next_tx].addr = (virt_to_phys((void *)packet))|TX_DMA_ENABLE;
 	au_sync();
 
 	udelay(1);
@@ -208,7 +208,8 @@ static int au1x00_recv(struct eth_device* dev){
 			NetReceive(NetRxPackets[next_rx], length - 4);
 		}
 
-		fifo_rx[next_rx].addr = (virt_to_phys(NetRxPackets[next_rx]))|RX_DMA_ENABLE;
+		fifo_rx[next_rx].addr =
+			virt_to_phys((void *)NetRxPackets[next_rx])|RX_DMA_ENABLE;
 
 		next_rx++;
 		if(next_rx>=NO_OF_FIFOS){
@@ -249,7 +250,8 @@ static int au1x00_init(struct eth_device* dev, bd_t * bd){
 	for(i=0;i<NO_OF_FIFOS;i++){
 		fifo_tx[i].len = 0;
 		fifo_tx[i].addr = virt_to_phys(&txbuf[0]);
-		fifo_rx[i].addr = (virt_to_phys(NetRxPackets[i]))|RX_DMA_ENABLE;
+		fifo_rx[i].addr =
+			virt_to_phys((void *)NetRxPackets[i])|RX_DMA_ENABLE;
 	}
 
 	/* Put mac addr in little endian */
-- 
1.6.1.1.230.gdfb04



More information about the U-Boot mailing list