diff options
author | Antoine Ténart <antoine.tenart@free-electrons.com> | 2014-10-03 17:08:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-06 03:18:56 +0200 |
commit | e885439f37b0dce404291350f7c0368c2bb97cdb (patch) | |
tree | ebf379b05be5df78cb25546dddde853d5546d8f6 /drivers/net/ethernet/marvell | |
parent | Merge branch 'isdn-next' (diff) | |
download | linux-e885439f37b0dce404291350f7c0368c2bb97cdb.tar.xz linux-e885439f37b0dce404291350f7c0368c2bb97cdb.zip |
net: pxa168_eth: avoid using signed char for bitops
Signedness bugs may occur when using signed char for bitops,
depending on if the highest bit is ever used.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r-- | drivers/net/ethernet/marvell/pxa168_eth.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c index 24de41231593..c3b209cd0660 100644 --- a/drivers/net/ethernet/marvell/pxa168_eth.c +++ b/drivers/net/ethernet/marvell/pxa168_eth.c @@ -634,12 +634,12 @@ static int pxa168_eth_set_mac_address(struct net_device *dev, void *addr) memcpy(oldMac, dev->dev_addr, ETH_ALEN); memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); - mac_h = sa->sa_data[0] << 24; - mac_h |= sa->sa_data[1] << 16; - mac_h |= sa->sa_data[2] << 8; - mac_h |= sa->sa_data[3]; - mac_l = sa->sa_data[4] << 8; - mac_l |= sa->sa_data[5]; + mac_h = dev->dev_addr[0] << 24; + mac_h |= dev->dev_addr[1] << 16; + mac_h |= dev->dev_addr[2] << 8; + mac_h |= dev->dev_addr[3]; + mac_l = dev->dev_addr[4] << 8; + mac_l |= dev->dev_addr[5]; wrl(pep, MAC_ADDR_HIGH, mac_h); wrl(pep, MAC_ADDR_LOW, mac_l); |