Skip to contentSkip to conversation

testing/radix-tree: fix a macro expansion bug

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 15, 2016

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

PATCH 1/1 testing/radix-tree: fix a macro expansion bug

There are no parentheses around this macro and it causes a problem when we do:

	index = rand() % THRASH_SIZE;
tools/testing/radix-tree/tag_check.c +1 -1
index b7447ce..b0ac057 100644
@@ -122,7 +122,7 @@ enum {
 	NODE_TAGGED = 2,
 };
 
-#define THRASH_SIZE		1000 * 1000
+#define THRASH_SIZE		(1000 * 1000)
 #define N 127
 #define BATCH	33
 
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

There are no parentheses around this macro and it causes a problem when we do:

	index = rand() % THRASH_SIZE;
Quoted 14 lines
tools/testing/radix-tree/tag_check.c +1 -1
index b7447ce..b0ac057 100644
@@ -122,7 +122,7 @@ enum {
 	NODE_TAGGED = 2,
 };
 
-#define THRASH_SIZE		1000 * 1000
+#define THRASH_SIZE		(1000 * 1000)
 #define N 127
 #define BATCH	33