Commit dd1f4078f0d2de74a308f00a2dffbd550cfba59f

Authored by Jeff Dike
Committed by Michael S. Tsirkin
1 parent 373a83a699

vhost-net: minor cleanup

Delete a label and goto from vhost_net_set_backend
Inverting a test allows a label and goto to be eliminated.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Showing 1 changed file with 5 additions and 6 deletions Side-by-side Diff

... ... @@ -519,13 +519,12 @@
519 519  
520 520 /* start polling new socket */
521 521 oldsock = vq->private_data;
522   - if (sock == oldsock)
523   - goto done;
  522 + if (sock != oldsock){
  523 + vhost_net_disable_vq(n, vq);
  524 + rcu_assign_pointer(vq->private_data, sock);
  525 + vhost_net_enable_vq(n, vq);
  526 + }
524 527  
525   - vhost_net_disable_vq(n, vq);
526   - rcu_assign_pointer(vq->private_data, sock);
527   - vhost_net_enable_vq(n, vq);
528   -done:
529 528 if (oldsock) {
530 529 vhost_net_flush_vq(n, index);
531 530 fput(oldsock->file);