lkml.org 
[lkml]   [2010]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] lib/btree: Kill unused MAX macro
On Thu, 13 May 2010 01:17:24 +0400
"Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com> wrote:

> Kill unused MAX macro
>
> Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
> ---
> diff --git a/lib/btree.c b/lib/btree.c
> index 41859a8..f833949 100644
> --- a/lib/btree.c
> +++ b/lib/btree.c
> @@ -45,7 +45,6 @@
> #include <linux/slab.h>
> #include <linux/module.h>
>
> -#define MAX(a, b) ((a) > (b) ? (a) : (b))

It's used on the very next line:

> #define NODESIZE MAX(L1_CACHE_BYTES, 128)

And we cannot use max() here because it's evaluated at compile-time.


Also, this reader is quite unable to determine why this forumation for
NODESIZE was chosen. As few kernel programmers can read Joern's mind,
I'd suggest that a code comment is in order.



\
 
 \ /
  Last update: 2010-05-13 22:27    [W:0.047 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site