xfs: fix simple_return.cocci warning in xfs_bmse_shift_one
authorkbuild test robot <fengguang.wu@intel.com>
Sun, 30 Nov 2014 21:42:52 +0000 (08:42 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 30 Nov 2014 21:42:52 +0000 (08:42 +1100)
fs/xfs/libxfs/xfs_bmap.c:5591:1-6: WARNING: end returns can be simpified

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Brian Foster <bfoster@redhat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
fs/xfs/libxfs/xfs_bmap.c

index 79c981984dcad0b60e2405cd2ba718405b8bd7ab..20d2e96aef6a29c4257454a53cafad4872f4bf7c 100644 (file)
@@ -5592,12 +5592,8 @@ shift_extent:
        XFS_WANT_CORRUPTED_GOTO(i == 1, out_error);
 
        got.br_startoff = startoff;
-       error = xfs_bmbt_update(cur, got.br_startoff, got.br_startblock,
+       return xfs_bmbt_update(cur, got.br_startoff, got.br_startblock,
                                got.br_blockcount, got.br_state);
-       if (error)
-               return error;
-
-       return 0;
 
 out_error:
        return error;