[4/5] btrfs: remove a useless return statement in btrfs_block_rsv_add
diff mbox series

Message ID 20180804131057.9967-5-lufq.fnst@cn.fujitsu.com
State New
Headers show
Series
  • some trivial cleanup about btrfs_delete_subvolume
Related show

Commit Message

Lu Fengqi Aug. 4, 2018, 1:10 p.m. UTC
Since ret must be 0 here, don't have to return separately in advance.

No functional change.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 fs/btrfs/extent-tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

David Sterba Aug. 17, 2018, 1:29 p.m. UTC | #1
On Sat, Aug 04, 2018 at 09:10:56PM +0800, Lu Fengqi wrote:
> Since ret must be 0 here, don't have to return separately in advance.
> 
> No functional change.
> 
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

Added to misc-next too, the change is fairly trivial so I was pondering
about code readability impacts, but it's ok.

Patch
diff mbox series

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4fb20f77d6b1..8bebf122d4b3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5539,10 +5539,8 @@  int btrfs_block_rsv_add(struct btrfs_root *root,
 		return 0;
 
 	ret = reserve_metadata_bytes(root, block_rsv, num_bytes, flush);
-	if (!ret) {
+	if (!ret)
 		block_rsv_add_bytes(block_rsv, num_bytes, true);
-		return 0;
-	}
 
 	return ret;
 }