mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: kirjanov@gmail.com
Cc: joern@logfs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] lib/btree: Kill unused MAX macro
Date: Thu, 13 May 2010 13:24:34 -0700	[thread overview]
Message-ID: <20100513132434.3b1515fa.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100512211724.GA5507@coldcone>

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.


  reply	other threads:[~2010-05-13 20:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 21:17 Denis Kirjanov <kirjanov@gmail.com
2010-05-13 20:24 ` Andrew Morton [this message]
2010-05-14 17:03   ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100513132434.3b1515fa.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=joern@logfs.org \
    --cc=kirjanov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome