diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-08-29 12:25:14 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-31 01:54:27 +0400 |
commit | 7d7628f3719e85e41d3948759ef969707036033d (patch) | |
tree | 1cf9e611107f14eb0133e22069e6c6566c8f9737 /drivers/net/ethernet/freescale | |
parent | f91b29f5b8709a3968ce0e155cfeab2bc6f733dd (diff) | |
download | linux-7d7628f3719e85e41d3948759ef969707036033d.tar.xz |
net/fec: cleanup types in fec_get_mac()
My static checker complains that on some arches unsigned longs can be 8
characters which is larger than the buffer is only 6 chars.
Additionally, Ben Hutchings points out that the buffer actually holds
big endian data and the buffer we are reading from is CPU endian.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 46019ba6e23a..0cd5e4b8b545 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1099,10 +1099,10 @@ static void fec_get_mac(struct net_device *ndev) * 4) FEC mac registers set by bootloader */ if (!is_valid_ether_addr(iap)) { - *((unsigned long *) &tmpaddr[0]) = - be32_to_cpu(readl(fep->hwp + FEC_ADDR_LOW)); - *((unsigned short *) &tmpaddr[4]) = - be16_to_cpu(readl(fep->hwp + FEC_ADDR_HIGH) >> 16); + *((__be32 *) &tmpaddr[0]) = + cpu_to_be32(readl(fep->hwp + FEC_ADDR_LOW)); + *((__be16 *) &tmpaddr[4]) = + cpu_to_be16(readl(fep->hwp + FEC_ADDR_HIGH) >> 16); iap = &tmpaddr[0]; } |