[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427355585-10365-1-git-send-email-roy.qing.li@gmail.com>
Date: Thu, 26 Mar 2015 15:39:45 +0800
From: roy.qing.li@...il.com
To: netdev@...r.kernel.org
Subject: [PATCH][net-next] virtio: simplify the using of received in virtnet_poll
From: Li RongQing <roy.qing.li@...il.com>
received is 0, no need to minus it and use "+=" to reassign it
Signed-off-by: Li RongQing <roy.qing.li@...il.com>
---
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 59b0e97..cb54ff7 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -749,9 +749,9 @@ static int virtnet_poll(struct napi_struct *napi, int budget)
{
struct receive_queue *rq =
container_of(napi, struct receive_queue, napi);
- unsigned int r, received = 0;
+ unsigned int r, received;
- received += virtnet_receive(rq, budget - received);
+ received = virtnet_receive(rq, budget);
/* Out of packets? */
if (received < budget) {
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists