Skip to contentSkip to conversation

net/bnxt: fix incorrect boolean operator usage

PATCH In review Lance Richardson 2 participants 2 messages Oct 22, 2020 – Oct 26, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: fix incorrect boolean operator usage

Use boolean AND operator instead of bitwise operator.

Coverity issue: 323488

Fixes b42c15c83e88 ("net/bnxt: support trusted VF")
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -1
index aa2d9e00e..3ee4b5524 100644
@@ -1547,7 +1547,7 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
 	if (rc)
 		return rc;
 
-	if (BNXT_VF(bp) & !BNXT_VF_IS_TRUSTED(bp)) {
+	if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp)) {
 		PMD_DRV_LOG(ERR, "Cannot add MAC address to a VF interface\n");
 		return -ENOTSUP;
 	}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Lance Richardson

Use boolean AND operator instead of bitwise operator.

Coverity issue: 323488

Fixes b42c15c83e88 ("net/bnxt: support trusted VF")

Patch applied to dpdk-next-net-brcm.

Quoted 20 lines
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -2
index aa2d9e00e..3ee4b5524 100644
@@ -1547,7 +1547,7 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
        if (rc)
                return rc;
 
-       if (BNXT_VF(bp) & !BNXT_VF_IS_TRUSTED(bp)) {
+       if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp)) {
                PMD_DRV_LOG(ERR, "Cannot add MAC address to a VF interface\n");
                return -ENOTSUP;
        }
--

2.25.1