From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: "Liam R . Howlett" <Liam.Howlett@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH 0/1] Dead stores in maple-tree
Date: Wed, 26 Oct 2022 14:00:28 +0200 [thread overview]
Message-ID: <20221026120029.12555-1-lukas.bulwahn@gmail.com> (raw)
Dear maple-tree authors, dear Liam, dear Matthew,
there are some Dead Stores that clang-analyzer reports:
lib/maple_tree.c:2906:2: warning: Value stored to 'last' is never read [clang-analyzer-deadcode.DeadStores]
lib/maple_tree.c:2907:2: warning: Value stored to 'prev_min' is never read [clang-analyzer-deadcode.DeadStores]
I addressed these two cases, which were most obvious and clear to fix;
see patch of this one-element series.
Further, clang-analyzer reports more, which I did not address:
lib/maple_tree.c:332:2: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
lib/maple_tree.c:337:2: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
Unclear to me if the tool is wrong or right in its analysis here for the two functions above.
lib/maple_tree.c:1212:23: warning: Value stored to 'nodep' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
A lot of pointer magic. Unclear to me if the tool is wrong or right in its analysis here.
lib/maple_tree.c:5014:5: warning: Value stored to 'count' is never read [clang-analyzer-deadcode.DeadStores]
Unclear if the code is intended as it is now.
In mas_anode_descend(), the variable count is really just assigned and used once
effectively. The second assignment is never read. So, the variable count could
just be removed in mas_anode_descend().
Maybe these further warnings are helpful to clean up the code or find an issue
that was overlooked so far.
Best regards,
Lukas
Lukas Bulwahn (1):
lib: maple_tree: remove unneeded initialization in mtree_range_walk()
lib/maple_tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.17.1
next reply other threads:[~2022-10-26 12:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 12:00 Lukas Bulwahn [this message]
2022-10-26 12:00 ` [PATCH 1/1] lib: maple_tree: remove unneeded initialization in mtree_range_walk() Lukas Bulwahn
2022-10-26 14:25 ` Liam Howlett
2022-10-26 14:23 ` [PATCH 0/1] Dead stores in maple-tree Liam Howlett
2022-10-27 7:43 ` Dan Carpenter
2022-10-27 17:16 ` Liam Howlett
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=20221026120029.12555-1-lukas.bulwahn@gmail.com \
--to=lukas.bulwahn@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).