Commit 7ea466f2256b02a7047dfd47d76a2f6c1e427e3e

Authored by Tetsuo Handa
Committed by Pekka Enberg
1 parent b56efcf0a4

slab: fix DEBUG_SLAB warning

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -3155,7 +3155,8 @@
3155 3155 objp += obj_offset(cachep);
3156 3156 if (cachep->ctor && cachep->flags & SLAB_POISON)
3157 3157 cachep->ctor(objp);
3158   - if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1)) {
  3158 + if (ARCH_SLAB_MINALIGN &&
  3159 + ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))) {
3159 3160 printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
3160 3161 objp, (int)ARCH_SLAB_MINALIGN);
3161 3162 }