]> git.sur5r.net Git - u-boot/commitdiff
net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules...
authorKim Phillips <kim.phillips@freescale.com>
Fri, 17 Jul 2009 17:17:00 +0000 (12:17 -0500)
committerBen Warren <biggerbadderben@gmail.com>
Thu, 23 Jul 2009 05:53:44 +0000 (22:53 -0700)
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 <kim.phillips@freescale.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
drivers/net/tsec.c

index 63fc02e44d1be1980145e0382772ee9ad4022855..5dc05e5a02e2d42edde471668a93265e24f05918 100644 (file)
@@ -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));