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,
chongjiapeng <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH v2] btrfs: Remove redundant assignment of slot and leaf
Date: Wed, 5 Jan 2022 23:07:58 +0800 [thread overview]
Message-ID: <20220105150758.29670-1-jiapeng.chong@linux.alibaba.com> (raw)
From: chongjiapeng <jiapeng.chong@linux.alibaba.com>
slot and leaf are being initialized to path->slots[0] and
path->nodes[0], but this is never read as slot and leaf
is overwritten later on. Remove the redundant assignment.
Cleans up the following clang-analyzer warning:
fs/btrfs/tree-log.c:6125:7: warning: Value stored to 'slot' during its
initialization is never read [clang-analyzer-deadcode.DeadStores].
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: chongjiapeng <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
-Remove redundant assignment of leaf.
fs/btrfs/tree-log.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 4b89ac769347..d99cda0acd95 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -6188,8 +6188,6 @@ static int log_new_ancestors(struct btrfs_trans_handle *trans,
if (ret < 0)
return ret;
- leaf = path->nodes[0];
- slot = path->slots[0];
if (slot >= btrfs_header_nritems(leaf)) {
ret = btrfs_next_leaf(root, path);
if (ret < 0)
--
2.19.1.6.gb485710b
next reply other threads:[~2022-01-05 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 15:07 Jiapeng Chong [this message]
2022-01-05 16:11 ` [PATCH v2] btrfs: Remove redundant assignment of slot and leaf Filipe Manana
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=20220105150758.29670-1-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@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