]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ppc4xx: Fix compilation warning in 4xx miiphy.c
authorStefan Roese <sr@denx.de>
Mon, 7 Sep 2009 08:52:24 +0000 (10:52 +0200)
committerStefan Roese <sr@denx.de>
Thu, 10 Sep 2009 12:38:17 +0000 (14:38 +0200)
This patch fixes the following compilation warning:

miiphy.c: In function 'emac4xx_miiphy_read':
miiphy.c:353: warning: dereferencing type-punned pointer will break
strict-aliasing rules

Signed-off-by: Stefan Roese <sr@denx.de>
cpu/ppc4xx/miiphy.c

index 6a92bf83648e77b2612bd93cc8d7641fc9bfd110..fa3bfc8d9f51f4e438613c9462424e18e39774d7 100644 (file)
@@ -350,7 +350,7 @@ int emac4xx_miiphy_read (char *devname, unsigned char addr, unsigned char reg,
                return -1;
 
        sta_reg = in_be32((void *)EMAC_STACR + emac_reg);
-       *value = *(u16 *)(&sta_reg);
+       *value = sta_reg >> 16;
 
        return 0;
 }