]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a double shift bug
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 19 Jun 2021 13:49:18 +0000 (16:49 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2021 19:14:11 +0000 (12:14 -0700)
commitac6422184e293191a7cec5bf8a8a5a1f70d1ae33
tree34185e939b247f5b1f7ddf349daffc3a80c63853
parent28fa56ad10181f001837f74f3ef05975f153dcb1
net: hns3: fix a double shift bug

These flags are used to set and test bits like this:

if (!test_bit(HCLGE_PTP_FLAG_TX_EN, &ptp->flags) ||

The issue is that test_bit() takes a bit number like 1, but we are
passing BIT(1) instead and it's testing BIT(BIT(1)).  This does not
cause a problem because it is always done consistently and the bit
values are very small.

Fixes: 541a8362ff41 ("net: hns3: add support for PTP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h