slab: fix DEBUG_SLAB warning
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Thu, 21 Jul 2011 00:42:45 +0000 (09:42 +0900)
committerPekka Enberg <penberg@kernel.org>
Fri, 22 Jul 2011 08:01:03 +0000 (11:01 +0300)
In commit c225150b "slab: fix DEBUG_SLAB build",
"if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))" is always true if
ARCH_SLAB_MINALIGN == 0. Do not print warning if ARCH_SLAB_MINALIGN == 0.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slab.c

index c3cb3598555a4bb53e4cf10587d0a72366d3624d..dc2f068c0b7d73d822f6826af35f0edf1a4f3c0d 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3155,7 +3155,8 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
        objp += obj_offset(cachep);
        if (cachep->ctor && cachep->flags & SLAB_POISON)
                cachep->ctor(objp);
-       if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1)) {
+       if (ARCH_SLAB_MINALIGN &&
+           ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))) {
                printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
                       objp, (int)ARCH_SLAB_MINALIGN);
        }