net/bnxt: fix incorrect boolean operator usage
diff mbox series

Message ID 20201022184510.182976-1-lance.richardson@broadcom.com
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series
  • net/bnxt: fix incorrect boolean operator usage
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Lance Richardson Oct. 22, 2020, 6:45 p.m. UTC
Use boolean AND operator instead of bitwise operator.

Coverity issue: 323488
Fixes: b42c15c83e88 ("net/bnxt: support trusted VF")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ajit Khaparde Oct. 26, 2020, 4:09 a.m. UTC | #1
On Thu, Oct 22, 2020 at 11:45 AM Lance Richardson
<lance.richardson@broadcom.com> wrote:
>
> Use boolean AND operator instead of bitwise operator.
>
> Coverity issue: 323488
> Fixes: b42c15c83e88 ("net/bnxt: support trusted VF")
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Patch applied to dpdk-next-net-brcm.

> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index aa2d9e00e..3ee4b5524 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -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
>

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index aa2d9e00e..3ee4b5524 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -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;
 	}