From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98D7CA0527; Mon, 9 Nov 2020 15:29:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0146469A4; Mon, 9 Nov 2020 15:28:48 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 160F26947 for ; Mon, 9 Nov 2020 15:28:44 +0100 (CET) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CVCz420G0zkhYR for ; Mon, 9 Nov 2020 22:28:32 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Mon, 9 Nov 2020 22:28:34 +0800 From: Lijun Ou To: CC: , Date: Mon, 9 Nov 2020 22:28:58 +0800 Message-ID: <1604932142-19900-3-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604932142-19900-1-git-send-email-oulijun@huawei.com> References: <1604634716-43484-1-git-send-email-oulijun@huawei.com> <1604932142-19900-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 2/6] net/hns3: use unsigned types for bit operator X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Hongbo Zheng According to bit operator reliability style, variables in the right expression participating int bit operation must be an unsigned type. Signed-off-by: Hongbo Zheng Signed-off-by: Lijun Ou --- V2->V3: - fix commit log for correct descriptions - fix unnecessary variable declarations line merge V1->V2: - no fix --- drivers/net/hns3/hns3_ethdev_vf.c | 2 +- drivers/net/hns3/hns3_rxtx_vec_neon.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 6f71cd6..2e9bfda 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1331,7 +1331,7 @@ hns3vf_get_tc_info(struct hns3_hw *hw) { uint8_t resp_msg; int ret; - int i; + uint32_t i; ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_TCINFO, 0, NULL, 0, true, &resp_msg, sizeof(resp_msg)); diff --git a/drivers/net/hns3/hns3_rxtx_vec_neon.h b/drivers/net/hns3/hns3_rxtx_vec_neon.h index 8d7721b..54addbf 100644 --- a/drivers/net/hns3/hns3_rxtx_vec_neon.h +++ b/drivers/net/hns3/hns3_rxtx_vec_neon.h @@ -93,9 +93,10 @@ hns3_desc_parse_field(struct hns3_rx_queue *rxq, struct rte_mbuf *pkt; uint32_t retcode = 0; uint32_t cksum_err; - int ret, i; + uint32_t i; + int ret; - for (i = 0; i < (int)bd_vld_num; i++) { + for (i = 0; i < bd_vld_num; i++) { pkt = sw_ring[i].mbuf; /* init rte_mbuf.rearm_data last 64-bit */ @@ -131,7 +132,8 @@ hns3_recv_burst_vec(struct hns3_rx_queue *__restrict rxq, struct hns3_desc *rxdp = &rxq->rx_ring[rx_id]; uint32_t bd_valid_num, parse_retcode; uint16_t nb_rx = 0; - int pos, offset; + uint32_t pos; + int offset; /* mask to shuffle from desc to mbuf's rx_descriptor_fields1 */ uint8x16_t shuf_desc_fields_msk = { -- 2.7.4