From: Filipe Manana Date: Wed, 5 Feb 2025 11:50:48 +0000 (+0000) Subject: btrfs: send: simplify return logic from fs_path_prepare_for_add() X-Git-Tag: v6.15-rc1~152^2~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=147ff868609b99b48fb67cad54b41372cac23f3b;p=thirdparty%2Flinux.git btrfs: send: simplify return logic from fs_path_prepare_for_add() There is no need to have an 'out' label and jump into it since there are no resource cleanups to perform (release locks, free memory, etc), so make this simpler by removing the label and goto and instead return directly. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 9f9885dc1e10a..535384028cb85 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -535,7 +535,7 @@ static int fs_path_prepare_for_add(struct fs_path *p, int name_len, new_len++; ret = fs_path_ensure_buf(p, new_len); if (ret < 0) - goto out; + return ret; if (p->reversed) { if (p->start != p->end) @@ -550,8 +550,7 @@ static int fs_path_prepare_for_add(struct fs_path *p, int name_len, *p->end = 0; } -out: - return ret; + return 0; } static int fs_path_add(struct fs_path *p, const char *name, int name_len)