Skip to content

Commit 1b9c918

Browse files
bulwahnakpm00
authored andcommitted
lib: maple_tree: remove unneeded initialization in mtree_range_walk()
Before the do-while loop in mtree_range_walk(), the variables next, min, max need to be initialized. The variables last, prev_min and prev_max are set within the loop body before they are eventually used after exiting the loop body. As it is a do-while loop, the loop body is executed at least once, so the variables last, prev_min and prev_max do not need to be initialized before the loop body. Remove unneeded initialization of last and prev_min. The needless initialization was reported by clang-analyzer as Dead Stores. As the compiler already identifies these assignments as unneeded, it optimizes the assignments away. Hence: No functional change. No change in object code. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Lukas Bulwahn <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1db43d3 commit 1b9c918

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/maple_tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,8 +2903,8 @@ static inline void *mtree_range_walk(struct ma_state *mas)
29032903
unsigned long max, min;
29042904
unsigned long prev_max, prev_min;
29052905

2906-
last = next = mas->node;
2907-
prev_min = min = mas->min;
2906+
next = mas->node;
2907+
min = mas->min;
29082908
max = mas->max;
29092909
do {
29102910
offset = 0;

0 commit comments

Comments
 (0)