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 C148DA0547; Mon, 27 Sep 2021 11:23:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40D67406A3; Mon, 27 Sep 2021 11:23:12 +0200 (CEST) Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by mails.dpdk.org (Postfix) with ESMTP id 597DA4003D for ; Mon, 27 Sep 2021 07:09:41 +0200 (CEST) Received: from spf.mail.chinamobile.com (unknown[172.16.121.89]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec6151520191c-da844; Mon, 27 Sep 2021 13:09:23 +0800 (CST) X-RM-TRANSID: 2eec6151520191c-da844 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from chenjilei.localdomain (unknown[223.112.32.184]) by rmsmtp-syy-appsvrnew05-12026 (RichMail) with SMTP id 2efa615151fa391-7c504; Mon, 27 Sep 2021 13:09:23 +0800 (CST) X-RM-TRANSID: 2efa615151fa391-7c504 From: jilei chen To: xiao.w.wang@intel.com Cc: dev@dpdk.org Date: Mon, 27 Sep 2021 13:17:37 +0800 Message-Id: <20210927051737.18505-1-chenjilei@cmss.chinamobile.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20210926164518.8982-1-chenjilei@cmss.chinamobile.com> References: <20210926164518.8982-1-chenjilei@cmss.chinamobile.com> X-Mailman-Approved-At: Mon, 27 Sep 2021 11:23:10 +0200 Subject: [dpdk-dev] [PATCH] vdpa/ifc: increase readability in function 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" Optimize several parameters form order to better readability Signed-off-by: jilei chen --- drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 1dc813d0a3..365da2a8b9 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -182,7 +182,7 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal) } static int -ifcvf_dma_map(struct ifcvf_internal *internal, int do_map) +ifcvf_dma_map(struct ifcvf_internal *internal, bool do_map) { uint32_t i; int ret; @@ -538,11 +538,11 @@ update_datapath(struct ifcvf_internal *internal) if (!rte_atomic32_read(&internal->running) && (rte_atomic32_read(&internal->started) && rte_atomic32_read(&internal->dev_attached))) { - ret = ifcvf_dma_map(internal, 1); + ret = ifcvf_dma_map(internal, true); if (ret) goto err; - ret = vdpa_enable_vfio_intr(internal, 0); + ret = vdpa_enable_vfio_intr(internal, false); if (ret) goto err; @@ -568,7 +568,7 @@ update_datapath(struct ifcvf_internal *internal) if (ret) goto err; - ret = ifcvf_dma_map(internal, 0); + ret = ifcvf_dma_map(internal, false); if (ret) goto err; @@ -850,7 +850,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal) goto error; /* set up interrupt for interrupt relay */ - ret = vdpa_enable_vfio_intr(internal, 1); + ret = vdpa_enable_vfio_intr(internal, true); if (ret) goto unmap; @@ -875,7 +875,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal) unset_intr: vdpa_disable_vfio_intr(internal); unmap: - ifcvf_dma_map(internal, 0); + ifcvf_dma_map(internal, false); error: return -1; } @@ -934,7 +934,7 @@ ifcvf_dev_close(int vid) vdpa_disable_vfio_intr(internal); /* unset DMA map for guest memory */ - ifcvf_dma_map(internal, 0); + ifcvf_dma_map(internal, false); internal->sw_fallback_running = false; } else { @@ -1130,7 +1130,7 @@ ifcvf_set_vring_state(int vid, int vring, int state) } if (state && !hw->vring[vring].enable) { - ret = vdpa_enable_vfio_intr(internal, 0); + ret = vdpa_enable_vfio_intr(internal, false); if (ret) return ret; } -- 2.12.2