diff mbox series

btrfs: clean up an error code in btrfs_insert_raid_extent()

Message ID ce098f42-f12c-4bc2-b37f-2f35c572eecf@moroto.mountain (mailing list archive)
State New, archived
Headers show
Series btrfs: clean up an error code in btrfs_insert_raid_extent() | expand

Commit Message

Dan Carpenter Oct. 12, 2023, 9:42 a.m. UTC
It's more obvious to return a literal zero instead of "return ret;".
Plus Smatch complains that ret could be uninitialized if the
ordered_extent->bioc_list list is empty and this silences that
warning.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 fs/btrfs/raid-stripe-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba Oct. 13, 2023, 3:49 p.m. UTC | #1
On Thu, Oct 12, 2023 at 12:42:55PM +0300, Dan Carpenter wrote:
> It's more obvious to return a literal zero instead of "return ret;".
> Plus Smatch complains that ret could be uninitialized if the
> ordered_extent->bioc_list list is empty and this silences that
> warning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

With a slightly changed subject added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c
index 944e8f1862aa..9589362acfbf 100644
--- a/fs/btrfs/raid-stripe-tree.c
+++ b/fs/btrfs/raid-stripe-tree.c
@@ -145,7 +145,7 @@  int btrfs_insert_raid_extent(struct btrfs_trans_handle *trans,
 		btrfs_put_bioc(bioc);
 	}
 
-	return ret;
+	return 0;
 }
 
 int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info,