Skip to contentSkip to conversation

lib/test_meminit: use && for bools

PATCH Applied Alexander Potapenko 1 participant 1 message May 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/test_meminit: use && for bools

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.

---
 lib/test_meminit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_meminit.c +1 -1
index 6298f66c964b..d028a6552cd6 100644
@@ -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);
Signature · 1 line
2.54.0.545.g6539524ca2-goog