Skip to contentSkip to conversation

virtio: simplify the using of received in virtnet_poll

PATCH Applied [email protected] 2 participants 2 messages Mar 26, 2015 – Mar 29, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio: simplify the using of received in virtnet_poll

From: Li RongQing <[email protected]>

received is 0, no need to minus it and use "+=" to reassign it

---
 drivers/net/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/virtio_net.c +2 -2
index 59b0e97..cb54ff7 100644
@@ -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) {
Signature · 1 line
2.1.0