From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: clm@fb.com
Cc: josef@toxicpanda.com, dsterba@suse.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH] btrfs: Remove redundant assignment to ret
Date: Thu, 29 Apr 2021 18:15:20 +0800 [thread overview]
Message-ID: <1619691320-81639-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)
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
next reply other threads:[~2021-04-29 10:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 10:15 Jiapeng Chong [this message]
2021-04-29 12:55 ` David Sterba
2021-05-08 10:38 Jiapeng Chong
2021-05-10 13:41 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1619691320-81639-1-git-send-email-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®