From: Ferruh Yigit Date: Mon, 26 Sep 2016 15:39:30 +0000 (+0100) Subject: kni: prefer min_t to min X-Git-Tag: spdx-start~5589 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e479813505ccce66567fb2a23f0299cee894f06c;p=dpdk.git kni: prefer min_t to min Signed-off-by: Ferruh Yigit --- diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index bae81e6189..04a3d63d7a 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 eacfe3f86b..e460dd6858 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);