]> git.baikalelectronics.ru Git - kernel.git/commit
slab: fix DEBUG_SLAB build
authorHugh Dickins <hughd@google.com>
Mon, 11 Jul 2011 20:35:08 +0000 (13:35 -0700)
committerPekka Enberg <penberg@kernel.org>
Mon, 18 Jul 2011 12:20:49 +0000 (15:20 +0300)
commitb35782c1d2321f041a4dcd76a99dc29e0e08a9f8
treec49c07c9ecaff0a90355fbb79f3e3d262fa5943a
parent823f39cb39eb19adfe3151781d9993489f049a38
slab: fix DEBUG_SLAB build

Fix CONFIG_SLAB=y CONFIG_DEBUG_SLAB=y build error and warnings.

Now that ARCH_SLAB_MINALIGN defaults to __alignof__(unsigned long long),
it is always defined (when slab.h included), but cannot be used in #if:
mm/slab.c: In function `cache_alloc_debugcheck_after':
mm/slab.c:3156:5: warning: "__alignof__" is not defined
mm/slab.c:3156:5: error: missing binary operator before token "("
make[1]: *** [mm/slab.o] Error 1

So just remove the #if and #endif lines, but then 64-bit build warns:
mm/slab.c: In function `cache_alloc_debugcheck_after':
mm/slab.c:3156:6: warning: cast from pointer to integer of different size
mm/slab.c:3158:10: warning: format `%d' expects type `int', but argument
                            3 has type `long unsigned int'
Fix those with casts, whatever the actual type of ARCH_SLAB_MINALIGN.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slab.c