* [PATCH v1] lib/test_meminit: use && for bools
@ 2026-05-04 10:06 Alexander Potapenko
0 siblings, 0 replies; only message in thread
From: Alexander Potapenko @ 2026-05-04 10:06 UTC (permalink / raw)
To: glider; +Cc: akpm, linux-mm, linux-kernel, Dan Carpenter
As pointed out by Dan Carpenter, test_kmemcache() was using a bitwise AND
on two bools instead of a boolean AND.
Fix this for the sake of code cleanliness.
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/kernel-janitors/afOcIan1ap9kD26M@stanley.mountain/
Fixes: 5015a300a522 ("lib: introduce test_meminit module")
Signed-off-by: Alexander Potapenko <glider@google.com>
---
lib/test_meminit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_meminit.c b/lib/test_meminit.c
index 6298f66c964b..d028a6552cd6 100644
--- a/lib/test_meminit.c
+++ b/lib/test_meminit.c
@@ -387,7 +387,7 @@ static int __init test_kmemcache(int *total_failures)
ctor = flags & 1;
rcu = flags & 2;
zero = flags & 4;
- if (ctor & zero)
+ if (ctor && zero)
continue;
num_tests += do_kmem_cache_size(size, ctor, rcu, zero,
&failures);
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-04 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 10:06 [PATCH v1] lib/test_meminit: use && for bools Alexander Potapenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox