Skip to content

Commit fc0e738

Browse files
Rtoaxakpm00
authored andcommitted
lib/radix-tree.c: fix uninitialized variable compilation warning
We need to set an initial value for offset to eliminate compilation warning. How to reproduce warning: $ make -C tools/testing/radix-tree radix-tree.c: In function `radix_tree_tag_clear': radix-tree.c:1046:17: warning: `offset' may be used uninitialized in this function [-Wmaybe-uninitialized] 1046 | node_tag_clear(root, parent, tag, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Rong Tao <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 08fc35f commit fc0e738

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/radix-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ void *radix_tree_tag_clear(struct radix_tree_root *root,
10291029
{
10301030
struct radix_tree_node *node, *parent;
10311031
unsigned long maxindex;
1032-
int offset;
1032+
int offset = 0;
10331033

10341034
radix_tree_load_root(root, &node, &maxindex);
10351035
if (index > maxindex)

0 commit comments

Comments
 (0)