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

net: spider_net: 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>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f6a6701
......@@ -1325,9 +1325,9 @@ spider_net_set_mac(struct net_device *netdev, void *p)
spider_net_write_reg(card, SPIDER_NET_GMACOPEMD, regvalue);
/* write mac */
macu = (addr->sa_data[0]<<24) + (addr->sa_data[1]<<16) +
(addr->sa_data[2]<<8) + (addr->sa_data[3]);
macl = (addr->sa_data[4]<<8) + (addr->sa_data[5]);
macu = (netdev->dev_addr[0]<<24) + (netdev->dev_addr[1]<<16) +
(netdev->dev_addr[2]<<8) + (netdev->dev_addr[3]);
macl = (netdev->dev_addr[4]<<8) + (netdev->dev_addr[5]);
spider_net_write_reg(card, SPIDER_NET_GMACUNIMACU, macu);
spider_net_write_reg(card, SPIDER_NET_GMACUNIMACL, macl);
......
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