From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 862A8558C for ; Thu, 15 Sep 2016 17:48:33 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP; 15 Sep 2016 08:48:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,339,1470726000"; d="scan'208";a="8961045" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga006.fm.intel.com with ESMTP; 15 Sep 2016 08:48:31 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Stephen Hemminger , Ferruh Yigit Date: Thu, 15 Sep 2016 16:46:37 +0100 Message-Id: <1473954405-7150-12-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> References: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH 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: Thu, 15 Sep 2016 15:48:34 -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 81d139e..a6458fa 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -139,7 +139,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, (void **)va, num_rx); @@ -236,7 +236,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) @@ -316,7 +316,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