diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-06-19 16:49:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-21 22:14:11 +0300 |
commit | 956c3ae411b2746c5018e0454909eb8c662b31ef (patch) | |
tree | 34185e939b247f5b1f7ddf349daffc3a80c63853 /drivers/net/ethernet/hisilicon | |
parent | faebad853455b7126450c1690f7c31e048213543 (diff) | |
download | linux-956c3ae411b2746c5018e0454909eb8c662b31ef.tar.xz |
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: 0bf5eb788512 ("net: hns3: add support for PTP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h index b3ca7afdaaa6..5a202b775471 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h @@ -43,9 +43,9 @@ #define HCLGE_PTP_SEC_H_OFFSET 32u #define HCLGE_PTP_SEC_L_MASK GENMASK(31, 0) -#define HCLGE_PTP_FLAG_EN BIT(0) -#define HCLGE_PTP_FLAG_TX_EN BIT(1) -#define HCLGE_PTP_FLAG_RX_EN BIT(2) +#define HCLGE_PTP_FLAG_EN 0 +#define HCLGE_PTP_FLAG_TX_EN 1 +#define HCLGE_PTP_FLAG_RX_EN 2 struct hclge_ptp { struct hclge_dev *hdev; |