* [PATCH] maple_tree: avoid duplicate variable init in mast_spanning_rebalance()
@ 2024-01-22 10:20 Lukas Bulwahn
2024-01-22 14:58 ` Liam R. Howlett
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Bulwahn @ 2024-01-22 10:20 UTC (permalink / raw)
To: Andrew Morton, Liam R . Howlett, maple-tree, linux-mm
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
The local variables r_tmp and l_tmp in mast_spanning_rebalance() are
already initialized at its declaration; there is no need to assign the
value again.
Remove the duplicate initialization of {r,l}_tmp. No functional change.
Due to common compiler optimizations, also no change to object code.
This issue was identified with clang-analyzer's dead stores analysis.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
lib/maple_tree.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 7b161802860b..82fb5195c235 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2271,8 +2271,6 @@ bool mast_spanning_rebalance(struct maple_subtree_state *mast)
struct ma_state l_tmp = *mast->orig_l;
unsigned char depth = 0;
- r_tmp = *mast->orig_r;
- l_tmp = *mast->orig_l;
do {
mas_ascend(mast->orig_r);
mas_ascend(mast->orig_l);
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] maple_tree: avoid duplicate variable init in mast_spanning_rebalance()
2024-01-22 10:20 [PATCH] maple_tree: avoid duplicate variable init in mast_spanning_rebalance() Lukas Bulwahn
@ 2024-01-22 14:58 ` Liam R. Howlett
0 siblings, 0 replies; 2+ messages in thread
From: Liam R. Howlett @ 2024-01-22 14:58 UTC (permalink / raw)
To: Lukas Bulwahn
Cc: Andrew Morton, maple-tree, linux-mm, kernel-janitors, linux-kernel
* Lukas Bulwahn <lukas.bulwahn@gmail.com> [240122 05:22]:
> The local variables r_tmp and l_tmp in mast_spanning_rebalance() are
> already initialized at its declaration; there is no need to assign the
> value again.
>
> Remove the duplicate initialization of {r,l}_tmp. No functional change.
> Due to common compiler optimizations, also no change to object code.
Hello!
Thanks for this patch and well stated change log.
>
> This issue was identified with clang-analyzer's dead stores analysis.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
> lib/maple_tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index 7b161802860b..82fb5195c235 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -2271,8 +2271,6 @@ bool mast_spanning_rebalance(struct maple_subtree_state *mast)
> struct ma_state l_tmp = *mast->orig_l;
> unsigned char depth = 0;
>
> - r_tmp = *mast->orig_r;
> - l_tmp = *mast->orig_l;
> do {
> mas_ascend(mast->orig_r);
> mas_ascend(mast->orig_l);
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-22 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 10:20 [PATCH] maple_tree: avoid duplicate variable init in mast_spanning_rebalance() Lukas Bulwahn
2024-01-22 14:58 ` Liam R. Howlett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox