Skip to content

Commit

Permalink
virtio: simplify the using of received in virtnet_poll
Browse files Browse the repository at this point in the history
received is 0, no need to minus it and use "+=" to reassign it

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Mar 29, 2015
1 parent 3556eaa commit faadb05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit faadb05

Please sign in to comment.