]> git.droids-corp.org - dpdk.git/commitdiff
net/hns3: use unsigned integer for bitwise operations
authorHuisong Li <lihuisong@huawei.com>
Sat, 6 Nov 2021 01:43:01 +0000 (09:43 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 8 Nov 2021 14:59:14 +0000 (15:59 +0100)
Bitwise operations should be used only with unsigned integer. This patch
modifies some code that does not meet this rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/hns3/hns3_ethdev.c

index c5543c48ef98c681acbb589071488150e0e6a090..ddf85a1705d5a8a5815c2b40b3644956bebfdd59 100644 (file)
@@ -2104,7 +2104,7 @@ hns3_check_mq_mode(struct rte_eth_dev *dev)
        int max_tc = 0;
        int i;
 
-       if ((rx_mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) ||
+       if (((uint32_t)rx_mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) ||
            (tx_mq_mode == RTE_ETH_MQ_TX_VMDQ_DCB ||
             tx_mq_mode == RTE_ETH_MQ_TX_VMDQ_ONLY)) {
                hns3_err(hw, "VMDQ is not supported, rx_mq_mode = %d, tx_mq_mode = %d.",
@@ -2114,7 +2114,7 @@ hns3_check_mq_mode(struct rte_eth_dev *dev)
 
        dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf;
        dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf;
-       if (rx_mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) {
+       if ((uint32_t)rx_mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) {
                if (dcb_rx_conf->nb_tcs > pf->tc_max) {
                        hns3_err(hw, "nb_tcs(%u) > max_tc(%u) driver supported.",
                                 dcb_rx_conf->nb_tcs, pf->tc_max);