From: Kim Phillips Date: Fri, 17 Jul 2009 17:17:00 +0000 (-0500) Subject: net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules... X-Git-Tag: v2009.08-rc1~32^2~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88ad3fd91c83a4343b25385fd78fd8e29ebb723f;p=u-boot net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning fix this gcc 4.4 warning: tsec.c: In function 'tsec_init': tsec.c:200: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Kim Phillips Signed-off-by: Ben Warren --- diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 63fc02e44d..5dc05e5a02 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -197,7 +197,10 @@ int tsec_init(struct eth_device *dev, bd_t * bd) for (i = 0; i < MAC_ADDR_LEN; i++) { tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->enetaddr[i]; } - regs->macstnaddr1 = *((uint *) (tmpbuf)); + tempval = (tmpbuf[0] << 24) | (tmpbuf[1] << 16) | (tmpbuf[2] << 8) | + tmpbuf[3]; + + regs->macstnaddr1 = tempval; tempval = *((uint *) (tmpbuf + 4));