lkml.org 
[lkml]   [2021]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] btrfs: Remove redundant assignment to ret
Date
Variable ret is set to zero but this value is never read as it
is overwritten or not used later on, hence it is a redundant
assignment and can be removed.

Cleans up the following clang-analyzer warning:

fs/btrfs/volumes.c:8019:4: warning: Value stored to 'ret' is never read
[clang-analyzer-deadcode.DeadStores].

fs/btrfs/volumes.c:4757:4: warning: Value stored to 'ret' is never read
[clang-analyzer-deadcode.DeadStores].

fs/btrfs/volumes.c:7951:4: warning: Value stored to 'ret' is never read
[clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
fs/btrfs/volumes.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9a1ead0..30504fa 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4754,7 +4754,6 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
mutex_unlock(&fs_info->reclaim_bgs_lock);
if (ret < 0)
goto done;
- ret = 0;
btrfs_release_path(path);
break;
}
@@ -7939,7 +7938,7 @@ int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info)
struct btrfs_key key;
u64 prev_devid = 0;
u64 prev_dev_ext_end = 0;
- int ret = 0;
+ int ret;

/*
* We don't have a dev_root because we mounted with ignorebadroots and
@@ -8016,7 +8015,6 @@ int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info)
if (ret < 0)
goto out;
if (ret > 0) {
- ret = 0;
break;
}
}
--
1.8.3.1
\
 
 \ /
  Last update: 2021-04-29 12:17    [W:0.063 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site