All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] testing/radix-tree: fix a macro expansion bug
@ 2016-07-15 21:09 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-07-15 21:09 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Andrew Morton, Ross Zwisler, Konstantin Khlebnikov, linux-kernel,
	kernel-janitors

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

	index = rand() % THRASH_SIZE;

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c
index b7447ce..b0ac057 100644
--- a/tools/testing/radix-tree/tag_check.c
+++ b/tools/testing/radix-tree/tag_check.c
@@ -122,7 +122,7 @@ enum {
 	NODE_TAGGED = 2,
 };
 
-#define THRASH_SIZE		1000 * 1000
+#define THRASH_SIZE		(1000 * 1000)
 #define N 127
 #define BATCH	33
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] testing/radix-tree: fix a macro expansion bug
@ 2016-07-15 21:09 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-07-15 21:09 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Andrew Morton, Ross Zwisler, Konstantin Khlebnikov, linux-kernel,
	kernel-janitors

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

	index = rand() % THRASH_SIZE;

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c
index b7447ce..b0ac057 100644
--- a/tools/testing/radix-tree/tag_check.c
+++ b/tools/testing/radix-tree/tag_check.c
@@ -122,7 +122,7 @@ enum {
 	NODE_TAGGED = 2,
 };
 
-#define THRASH_SIZE		1000 * 1000
+#define THRASH_SIZE		(1000 * 1000)
 #define N 127
 #define BATCH	33
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] testing/radix-tree: fix a macro expansion bug
  2016-07-15 21:09 ` Dan Carpenter
@ 2016-07-15 21:42   ` Ross Zwisler
  -1 siblings, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2016-07-15 21:42 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Matthew Wilcox, Andrew Morton, Ross Zwisler,
	Konstantin Khlebnikov, linux-kernel, kernel-janitors

On Sat, Jul 16, 2016 at 12:09:53AM +0300, Dan Carpenter wrote:
> There are no parentheses around this macro and it causes a problem when
> we do:
> 
> 	index = rand() % THRASH_SIZE;
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Ross Zwisler <ross.zwisler@linux.intel.com>

> 
> diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c
> index b7447ce..b0ac057 100644
> --- a/tools/testing/radix-tree/tag_check.c
> +++ b/tools/testing/radix-tree/tag_check.c
> @@ -122,7 +122,7 @@ enum {
>  	NODE_TAGGED = 2,
>  };
>  
> -#define THRASH_SIZE		1000 * 1000
> +#define THRASH_SIZE		(1000 * 1000)
>  #define N 127
>  #define BATCH	33
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] testing/radix-tree: fix a macro expansion bug
@ 2016-07-15 21:42   ` Ross Zwisler
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2016-07-15 21:42 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Matthew Wilcox, Andrew Morton, Ross Zwisler,
	Konstantin Khlebnikov, linux-kernel, kernel-janitors

On Sat, Jul 16, 2016 at 12:09:53AM +0300, Dan Carpenter wrote:
> There are no parentheses around this macro and it causes a problem when
> we do:
> 
> 	index = rand() % THRASH_SIZE;
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Ross Zwisler <ross.zwisler@linux.intel.com>

> 
> diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c
> index b7447ce..b0ac057 100644
> --- a/tools/testing/radix-tree/tag_check.c
> +++ b/tools/testing/radix-tree/tag_check.c
> @@ -122,7 +122,7 @@ enum {
>  	NODE_TAGGED = 2,
>  };
>  
> -#define THRASH_SIZE		1000 * 1000
> +#define THRASH_SIZE		(1000 * 1000)
>  #define N 127
>  #define BATCH	33
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-15 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 21:09 [patch] testing/radix-tree: fix a macro expansion bug Dan Carpenter
2016-07-15 21:09 ` Dan Carpenter
2016-07-15 21:42 ` Ross Zwisler
2016-07-15 21:42   ` Ross Zwisler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.