The check for bool was accounting unwanted bits in the calulation of truth value

Signed-off-by: Tushar Mulkar <tmul...@sandvine.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index b96d77a0c..9c14ea278 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2095,7 +2095,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
        }
        /* full duplex only */
        new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-       new_link.link_status = vf->link_up ? ETH_LINK_UP :
+       new_link.link_status = (vf->link_up & true) ? ETH_LINK_UP :
                                             ETH_LINK_DOWN;
        new_link.link_autoneg =
                dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED;
-- 
2.11.0

Reply via email to