Skip to content

Commit b4e585f

Browse files
Lu Yaokdave
authored andcommitted
btrfs: scrub: initialize ret in scrub_simple_mirror() to fix compilation warning
The following error message is displayed: ../fs/btrfs/scrub.c:2152:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]" Compiler version: gcc version: (Debian 10.2.1-6) 10.2.1 20210110 Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Lu Yao <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0090d6e commit b4e585f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/scrub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
21002100
struct btrfs_fs_info *fs_info = sctx->fs_info;
21012101
const u64 logical_end = logical_start + logical_length;
21022102
u64 cur_logical = logical_start;
2103-
int ret;
2103+
int ret = 0;
21042104

21052105
/* The range must be inside the bg */
21062106
ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);

0 commit comments

Comments
 (0)