]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: avoid reusing return variable in nested block in btrfs_lookup_bio_sums
authorAnand Jain <anand.jain@oracle.com>
Fri, 10 Feb 2023 16:15:54 +0000 (00:15 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:13 +0000 (18:01 +0200)
The function btrfs_lookup_bio_sums() and a nested if statement declare
ret respectively as blk_status_t and int.

There is no need to store the return value of
search_file_offset_in_bio() to ret as this is a one-time call.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c

index 41c77a10085357dd983f43e7929fbdae1bc96055..89e9415b8f06dffb1c563ac63d736eab8694fcc0 100644 (file)
@@ -494,12 +494,11 @@ blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
                        if (inode->root->root_key.objectid ==
                            BTRFS_DATA_RELOC_TREE_OBJECTID) {
                                u64 file_offset;
-                               int ret;
 
-                               ret = search_file_offset_in_bio(bio,
-                                               &inode->vfs_inode,
-                                               cur_disk_bytenr, &file_offset);
-                               if (ret)
+                               if (search_file_offset_in_bio(bio,
+                                                             &inode->vfs_inode,
+                                                             cur_disk_bytenr,
+                                                             &file_offset))
                                        set_extent_bits(io_tree, file_offset,
                                                file_offset + sectorsize - 1,
                                                EXTENT_NODATASUM);