From: Jeff Dike on
commit 1191aa42193d030470dbd4ab17e4fb57772534ff
Author: Jeff Dike <jdike(a)localhost.localdomain>
Date: Thu Mar 4 14:51:20 2010 -0500

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(a)linux.intel.com>

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 4ada4b4..7abb883 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -518,13 +518,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)

/* start polling new socket */
oldsock = vq->private_data;
- if (sock == oldsock)
- goto done;
+ if (sock != oldsock){
+ vhost_net_disable_vq(n, vq);
+ rcu_assign_pointer(vq->private_data, sock);
+ vhost_net_enable_vq(n, vq);
+ }

- vhost_net_disable_vq(n, vq);
- rcu_assign_pointer(vq->private_data, sock);
- vhost_net_enable_vq(n, vq);
-done:
if (oldsock) {
vhost_net_flush_vq(n, index);
fput(oldsock->file);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/