[U-Boot-Users] [PATCH] rtl8169: fix compiler warnings

Guennadi Liakhovetski g.liakhovetski at gmx.de
Mon Apr 28 14:37:14 CEST 2008


Fix multiple compiler warnings related to argument type mismatch.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski at gmx.de>

---

On Mon, 28 Apr 2008, Wolfgang Denk wrote:

> In message <Pine.LNX.4.64.0803310112130.6825 at axis700.grange> you wrote:
> > This patch is based on the port by Mihai Georgian (see linkstation.c for 
> > Copyright information) and implements support for LinkStation / KuroBox HD 
> > and HG PPC models from Buffalo Technology, whereby HD is deactivated at 
> > the moment, pending network driver fixing.
> 
> The code throws a lot of compiler warnings:
> 
> ===== LOG/linkstation_HGLAN =====
> rtl8169.c: In function 'rtl_recv':
> rtl8169.c:438: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast
> rtl8169.c: In function 'rtl_send':
> rtl8169.c:484: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast
> rtl8169.c: In function 'rtl8169_hw_start':
> rtl8169.c:582: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast
> rtl8169.c:583: warning: passing argument 2 of 'out_le32' makes integer from pointer without a cast
> rtl8169.c: In function 'rtl8169_init_ring':
> rtl8169.c:628: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast

Patch below.

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index d39ac7c..6c4c9ff 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -435,7 +435,7 @@ static int rtl_recv(struct eth_device *dev)
 				tpc->RxDescArray[cur_rx].status =
 					cpu_to_le32(OWNbit + RX_BUF_SIZE);
 			tpc->RxDescArray[cur_rx].buf_addr =
-				cpu_to_le32(tpc->RxBufferRing[cur_rx]);
+				cpu_to_le32((unsigned long)tpc->RxBufferRing[cur_rx]);
 		} else {
 			puts("Error Rx");
 		}
@@ -481,7 +481,7 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length)
 	while (len < ETH_ZLEN)
 		ptxb[len++] = '\0';
 
-	tpc->TxDescArray[entry].buf_addr = cpu_to_le32(ptxb);
+	tpc->TxDescArray[entry].buf_addr = cpu_to_le32((unsigned long)ptxb);
 	if (entry != (NUM_TX_DESC - 1)) {
 		tpc->TxDescArray[entry].status =
 			cpu_to_le32((OWNbit | FSbit | LSbit) |
@@ -579,8 +579,8 @@ static void rtl8169_hw_start(struct eth_device *dev)
 
 	tpc->cur_rx = 0;
 
-	RTL_W32(TxDescStartAddr, tpc->TxDescArray);
-	RTL_W32(RxDescStartAddr, tpc->RxDescArray);
+	RTL_W32(TxDescStartAddr, (unsigned long)tpc->TxDescArray);
+	RTL_W32(RxDescStartAddr, (unsigned long)tpc->RxDescArray);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 	udelay(10);
 
@@ -625,7 +625,7 @@ static void rtl8169_init_ring(struct eth_device *dev)
 
 		tpc->RxBufferRing[i] = &rxb[i * RX_BUF_SIZE];
 		tpc->RxDescArray[i].buf_addr =
-			cpu_to_le32(tpc->RxBufferRing[i]);
+			cpu_to_le32((unsigned long)tpc->RxBufferRing[i]);
 	}
 
 #ifdef DEBUG_RTL8169




More information about the U-Boot mailing list