mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 00:47:26 +00:00
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>
This commit is contained in:
parent
2321bfe425
commit
6c169c12d7
1 changed files with 3 additions and 2 deletions
|
@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
|
||||||
u16 hwaddr_top;
|
u16 hwaddr_top;
|
||||||
|
|
||||||
/* set hardware address */
|
/* 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);
|
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);
|
macb_writel(macb, SA1T, hwaddr_top);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue