[U-Boot] [PATCH] drivers/net/natsemi.c: fix compile warning

Wolfgang Denk wd at denx.de
Fri Sep 11 11:18:20 CEST 2009


Fix warning: natsemi.c:757: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk <wd at denx.de>
Cc: Ben Warren <biggerbadderben at gmail.com>
---
 drivers/net/natsemi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index ce12c3b..e09da1d 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -754,7 +754,8 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
 {
 	u32 i, status = 0;
 	u32 tx_status = 0;
-	vu_long *res = (vu_long *)&tx_status;
+	u32 *tx_ptr = &tx_status;
+	vu_long *res = (vu_long *)tx_ptr;
 
 	/* Stop the transmitter */
 	OUTL(dev, TxOff, ChipCmd);
-- 
1.6.0.6



More information about the U-Boot mailing list