virtio: simplify the using of received in virtnet_poll
Subsystems (3)
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
Signed-off-by Li RongQing <[email protected]>
--- drivers/net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/virtio_net.c +2 -2
@@ -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
From: [email protected]
Date: Thu, 26 Mar 2015 15:39:45 +0800
Quoted 5 lines
From: Li RongQing <[email protected]>
received is 0, no need to minus it and use "+=" to reassign it
Signed-off-by Li RongQing <[email protected]>
Applied.