lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/11] ksm: trivial tidyups
On Mon, 28 Jan 2013, Andrew Morton wrote:
> On Fri, 25 Jan 2013 17:58:11 -0800 (PST)
> Hugh Dickins <hughd@google.com> wrote:
>
> > +#ifdef CONFIG_NUMA
> > +#define NUMA(x) (x)
> > +#define DO_NUMA(x) (x)
>
> Did we consider
>
> #define DO_NUMA do { (x) } while (0)
>
> ?

It didn't occur to me at all. I like that it makes more sense of
the DO_NUMA variant. Is it okay that, to work with the way I was
using it, we need "(x);" in there rather than just "(x)"?

>
> That could avoid some nasty config-dependent compilation issues.
>
> > +#else
> > +#define NUMA(x) (0)

[PATCH] ksm: trivial tidyups fix

Suggested by akpm: make DO_NUMA(x) do { (x); } while (0) more like the #else.

Signed-off-by: Hugh Dickins <hughd@google.com>
---

mm/ksm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- mmotm.org/mm/ksm.c 2013-01-27 09:55:45.000000000 -0800
+++ mmotm/mm/ksm.c 2013-01-28 16:50:25.772026446 -0800
@@ -43,7 +43,7 @@

#ifdef CONFIG_NUMA
#define NUMA(x) (x)
-#define DO_NUMA(x) (x)
+#define DO_NUMA(x) do { (x); } while (0)
#else
#define NUMA(x) (0)
#define DO_NUMA(x) do { } while (0)

\
 
 \ /
  Last update: 2013-01-29 03:21    [W:0.283 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site