All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] virtio: simplify the using of received in virtnet_poll
@ 2015-03-26  7:39 roy.qing.li
  2015-03-29 19:39 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2015-03-26  7:39 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

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

Signed-off-by: Li RongQing <roy.qing.li@gmail.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][net-next] virtio: simplify the using of received in virtnet_poll
  2015-03-26  7:39 [PATCH][net-next] virtio: simplify the using of received in virtnet_poll roy.qing.li
@ 2015-03-29 19:39 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-03-29 19:39 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev

From: roy.qing.li@gmail.com
Date: Thu, 26 Mar 2015 15:39:45 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> received is 0, no need to minus it and use "+=" to reassign it
> 
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-29 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26  7:39 [PATCH][net-next] virtio: simplify the using of received in virtnet_poll roy.qing.li
2015-03-29 19:39 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.