drbd: get rid of empty statement in is_valid_state
authorRoland Kammerer <roland.kammerer@linbit.com>
Mon, 13 Jun 2016 22:26:36 +0000 (00:26 +0200)
committerJens Axboe <axboe@fb.com>
Tue, 14 Jun 2016 03:43:07 +0000 (21:43 -0600)
This should silence a warning about an empty statement. Thanks to Fabian
Frederick <fabf@skynet.be> who sent a patch I modified to be smaller and
avoids an additional indent level.

Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_state.c

index aca68a581b06999ab97a7bb828d231558a182269..eea0c4aec9789efc4d7e561e03a569278147e159 100644 (file)
@@ -814,7 +814,7 @@ is_valid_state(struct drbd_device *device, union drbd_state ns)
        }
 
        if (rv <= 0)
-               /* already found a reason to abort */;
+               goto out; /* already found a reason to abort */
        else if (ns.role == R_SECONDARY && device->open_cnt)
                rv = SS_DEVICE_IN_USE;
 
@@ -862,6 +862,7 @@ is_valid_state(struct drbd_device *device, union drbd_state ns)
        else if (ns.conn >= C_CONNECTED && ns.pdsk == D_UNKNOWN)
                rv = SS_CONNECTED_OUTDATES;
 
+out:
        rcu_read_unlock();
 
        return rv;