* [PATCH] staging: virtio_net: use min_t() instead of min()
@ 2021-03-09 19:24 Lautaro Lecumberry
0 siblings, 0 replies; only message in thread
From: Lautaro Lecumberry @ 2021-03-09 19:24 UTC (permalink / raw)
Cc: lautarolecumberry, Michael S. Tsirkin, Jason Wang,
David S. Miller, Jakub Kicinski, virtualization, netdev,
linux-kernel
This patch fixes the following checkpatch warning:
WARNING: min() should probably be min_t(unsigned int, budget, virtqueue_get_vring_size(rq->vq))
1357: FILE: virtio_net.c:1357:
+ if (rq->vq->num_free > min((unsigned int)budget, virtqueue_get_vring_size(rq->vq)) / 2) {
Signed-off-by: Lautaro Lecumberry <lautarolecumberry@gmail.com>
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 82e520d2cb12..6b65f24c0130 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1354,7 +1354,7 @@ static int virtnet_receive(struct receive_queue *rq, int budget,
}
}
- if (rq->vq->num_free > min((unsigned int)budget, virtqueue_get_vring_size(rq->vq)) / 2) {
+ if (rq->vq->num_free > min_t(unsigned int, budget, virtqueue_get_vring_size(rq->vq)) / 2) {
if (!try_fill_recv(vi, rq, GFP_ATOMIC))
schedule_delayed_work(&vi->refill, 0);
}
--
2.30.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-09 19:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 19:24 [PATCH] staging: virtio_net: use min_t() instead of min() Lautaro Lecumberry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).