diff mbox series

[19/21] btrfs: remove pointless initialization at btrfs_delayed_refs_rsv_release()

Message ID b644560da59723f2d1400dca83675c427556f95a.1694174371.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: updates to delayed refs accounting and space reservation | expand

Commit Message

Filipe Manana Sept. 8, 2023, 12:09 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

There's no point in initializing to 0 the local variable 'released' as
we don't use it before the next assignment to it. So remove the
initialization. This may help avoid some warnings with clang tools such
as the one reported/fixed by commit 966de47ff0c9 ("btrfs: remove redundant
initialization of variables in log_new_ancestors").

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/delayed-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Josef Bacik Sept. 8, 2023, 3:16 p.m. UTC | #1
On Fri, Sep 08, 2023 at 01:09:21PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> There's no point in initializing to 0 the local variable 'released' as
> we don't use it before the next assignment to it. So remove the
> initialization. This may help avoid some warnings with clang tools such
> as the one reported/fixed by commit 966de47ff0c9 ("btrfs: remove redundant
> initialization of variables in log_new_ancestors").
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
diff mbox series

Patch

diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 067176ac5a2b..19dd74b236c6 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -66,7 +66,7 @@  void btrfs_delayed_refs_rsv_release(struct btrfs_fs_info *fs_info, int nr)
 {
 	struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv;
 	const u64 num_bytes = btrfs_calc_delayed_ref_bytes(fs_info, nr);
-	u64 released = 0;
+	u64 released;
 
 	released = btrfs_block_rsv_release(fs_info, block_rsv, num_bytes, NULL);
 	if (released)