* [PATCH v1] lib:Remove repeated initialization
@ 2023-07-06 14:03 Wang Ming
2023-07-06 14:45 ` Matthew Wilcox
0 siblings, 1 reply; 2+ messages in thread
From: Wang Ming @ 2023-07-06 14:03 UTC (permalink / raw)
To: Liam R. Howlett, linux-mm, linux-kernel; +Cc: opensource.kernel, Wang Ming
The original code initializes 'entry'
twice in line 3229 and 3232, which
causes duplicate initialization issue.
To fix this, we remove the initialization
of 'entry' in line 3229.
Signed-off-by: Wang Ming <machel@vivo.com>
---
lib/test_maple_tree.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c
index 9f60e0c4cc8c..2ec14c310dad 100644
--- a/lib/test_maple_tree.c
+++ b/lib/test_maple_tree.c
@@ -3226,7 +3226,6 @@ static noinline void __init check_state_handling(struct maple_tree *mt)
/* next: none -> active, skip value at location */
mas_set(&mas, 0);
- entry = mas_next(&mas, ULONG_MAX);
mas.node = MAS_NONE;
mas.offset = 0;
entry = mas_next(&mas, ULONG_MAX);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] lib:Remove repeated initialization
2023-07-06 14:03 [PATCH v1] lib:Remove repeated initialization Wang Ming
@ 2023-07-06 14:45 ` Matthew Wilcox
0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2023-07-06 14:45 UTC (permalink / raw)
To: Wang Ming; +Cc: Liam R. Howlett, linux-mm, linux-kernel, opensource.kernel
On Thu, Jul 06, 2023 at 10:03:01PM +0800, Wang Ming wrote:
> The original code initializes 'entry'
> twice in line 3229 and 3232, which
> causes duplicate initialization issue.
> To fix this, we remove the initialization
> of 'entry' in line 3229.
mas_next() has a side-effect; it's not a pure initialisation.
Fix your tool.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-06 14:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 14:03 [PATCH v1] lib:Remove repeated initialization Wang Ming
2023-07-06 14:45 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®