From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0A7CB2B9E for ; Mon, 26 Sep 2016 17:42:39 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 26 Sep 2016 08:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,400,1470726000"; d="scan'208";a="13327413" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by fmsmga006.fm.intel.com with ESMTP; 26 Sep 2016 08:42:38 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit Date: Mon, 26 Sep 2016 16:39:30 +0100 Message-Id: <20160926153938.7575-12-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20160926153938.7575-1-ferruh.yigit@intel.com> References: <1474043212-15663-1-git-send-email-ferruh.yigit@intel.com> <20160926153938.7575-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v3 11/19] kni: prefer min_t to min X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 15:42:41 -0000 Signed-off-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/kni_net.c | 6 +++--- lib/librte_eal/linuxapp/kni/kni_vhost.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index bae81e6..04a3d63 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -173,7 +173,7 @@ kni_net_rx_normal(struct kni_dev *kni) } /* Calculate the number of entries to dequeue from rx_q */ - num_rx = min(num_fq, (unsigned int)MBUF_BURST_SZ); + num_rx = min_t(unsigned int, num_fq, MBUF_BURST_SZ); /* Burst dequeue from rx_q */ num_rx = kni_fifo_get(kni->rx_q, kni->pa, num_rx); @@ -265,7 +265,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni) num = min(num_rq, num_tq); num = min(num, num_aq); num = min(num, num_fq); - num = min(num, (unsigned int)MBUF_BURST_SZ); + num = min_t(unsigned int, num, MBUF_BURST_SZ); /* Return if no entry to dequeue from rx_q */ if (num == 0) @@ -342,7 +342,7 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni) /* Calculate the number of entries to dequeue from rx_q */ num = min(num_rq, num_fq); - num = min(num, (unsigned int)MBUF_BURST_SZ); + num = min_t(unsigned int, num, MBUF_BURST_SZ); /* Return if no entry to dequeue from rx_q */ if (num == 0) diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c index eacfe3f..e460dd6 100644 --- a/lib/librte_eal/linuxapp/kni/kni_vhost.c +++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c @@ -299,7 +299,7 @@ kni_chk_vhost_rx(struct kni_dev *kni) nb_mbuf = kni_fifo_count(kni->rx_q); nb_in = min(nb_mbuf, nb_skb); - nb_in = min(nb_in, (unsigned int)RX_BURST_SZ); + nb_in = min_t(unsigned int, nb_in, RX_BURST_SZ); nb_burst = (nb_in & ~BURST_MASK); nb_backlog = (nb_in & BURST_MASK); -- 2.7.4