From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B209CA0C45; Sat, 6 Nov 2021 02:45:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49F7041124; Sat, 6 Nov 2021 02:45:17 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 31008410E7 for ; Sat, 6 Nov 2021 02:45:10 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4HmKrh3vxRz1DHHx for ; Sat, 6 Nov 2021 09:43:00 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Sat, 6 Nov 2021 09:45:08 +0800 From: "Min Hu (Connor)" To: CC: , Date: Sat, 6 Nov 2021 09:43:01 +0800 Message-ID: <20211106014306.28799-5-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211106014306.28799-1-humin29@huawei.com> References: <20211102031729.35536-1-humin29@huawei.com> <20211106014306.28799-1-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v3 4/9] net/hns3: use unsigned integer for bitwise operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li 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 Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index c5543c48ef..ddf85a1705 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -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); -- 2.33.0