summaryrefslogtreecommitdiff
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorandreas.devel@googlemail.com <andreas.devel@googlemail.com>2011-06-09 02:08:46 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-06-21 22:26:22 +0200
commit6c169c12d7782335be2f1d303622bcd0e1d00a02 (patch)
treef6e598c5c80804042d023c56dcdf37ead31e5f4f /drivers/net/macb.c
parent2321bfe425385494da8739d7d7e9dd3a5ca18a84 (diff)
macb: fix compile warning
This patch fixes following compile warning: ---8<--- macb.c: In function 'macb_write_hwaddr': macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules --->8--- Signed-off-by: Andreas Bießmann <andreas.devel@gmail.com>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 72ea1fc11d6..c63eea966af 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
u16 hwaddr_top;
/* set hardware address */
- hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
+ hwaddr_bottom = dev->enetaddr[0] | dev->enetaddr[1] << 8 |
+ dev->enetaddr[2] << 16 | dev->enetaddr[3] << 24;
macb_writel(macb, SA1B, hwaddr_bottom);
- hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
+ hwaddr_top = dev->enetaddr[4] | dev->enetaddr[5] << 8;
macb_writel(macb, SA1T, hwaddr_top);
return 0;
}