CI found integer handling issues, overflow before widen.

Coverity issue: 405351
Fixes: 87f5b35ba4e8 ("common/nfp: move queue logic")
Cc: sta...@dpdk.org

Signed-off-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Long Wu <long...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/common/nfp/nfp_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/nfp/nfp_common.c b/drivers/common/nfp/nfp_common.c
index 4c94c9d59a..40e1620c2e 100644
--- a/drivers/common/nfp/nfp_common.c
+++ b/drivers/common/nfp/nfp_common.c
@@ -187,14 +187,14 @@ nfp_enable_queues(struct nfp_hw *hw,
        /* Enabling the required TX queues in the device */
        enabled_queues = 0;
        for (i = 0; i < nb_tx_queues; i++)
-               enabled_queues |= (1 << i);
+               enabled_queues |= (1ULL << i);
 
        nn_cfg_writeq(hw, NFP_NET_CFG_TXRS_ENABLE, enabled_queues);
 
        /* Enabling the required RX queues in the device */
        enabled_queues = 0;
        for (i = 0; i < nb_rx_queues; i++)
-               enabled_queues |= (1 << i);
+               enabled_queues |= (1ULL << i);
 
        nn_cfg_writeq(hw, NFP_NET_CFG_RXRS_ENABLE, enabled_queues);
 }
-- 
2.39.1

Reply via email to