Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: Remove useless statement in split_node
@ 2020-11-12 11:24 Nikolay Borisov
  2020-11-12 12:14 ` Johannes Thumshirn
  2020-11-16 15:36 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Borisov @ 2020-11-12 11:24 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

At the point when we set 'ret = 0' it's guaranteed that the function is
going to return 0 so directly return 0. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/ctree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 6c309dfee3f5..04cff286dcc4 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3449,7 +3449,6 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
 			   (c_nritems - mid) * sizeof(struct btrfs_key_ptr));
 	btrfs_set_header_nritems(split, c_nritems - mid);
 	btrfs_set_header_nritems(c, mid);
-	ret = 0;
 
 	btrfs_mark_buffer_dirty(c);
 	btrfs_mark_buffer_dirty(split);
@@ -3467,7 +3466,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
 		btrfs_tree_unlock(split);
 		free_extent_buffer(split);
 	}
-	return ret;
+	return 0;
 }
 
 /*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Remove useless statement in split_node
  2020-11-12 11:24 [PATCH] btrfs: Remove useless statement in split_node Nikolay Borisov
@ 2020-11-12 12:14 ` Johannes Thumshirn
  2020-11-16 15:36 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2020-11-12 12:14 UTC (permalink / raw)
  To: Nikolay Borisov, linux-btrfs@vger.kernel.org

On 12/11/2020 12:24, Nikolay Borisov wrote:
> At the point when we set 'ret = 0' it's guaranteed that the function is
> going to return 0 so directly return 0. No functional changes.

Indeed,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Remove useless statement in split_node
  2020-11-12 11:24 [PATCH] btrfs: Remove useless statement in split_node Nikolay Borisov
  2020-11-12 12:14 ` Johannes Thumshirn
@ 2020-11-16 15:36 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2020-11-16 15:36 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

On Thu, Nov 12, 2020 at 01:24:02PM +0200, Nikolay Borisov wrote:
> At the point when we set 'ret = 0' it's guaranteed that the function is
> going to return 0 so directly return 0. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-16 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12 11:24 [PATCH] btrfs: Remove useless statement in split_node Nikolay Borisov
2020-11-12 12:14 ` Johannes Thumshirn
2020-11-16 15:36 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox