Commit e885439f authored by Antoine Ténart's avatar Antoine Ténart Committed by David S. Miller

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: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5555dfdc
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment