mm/slab: restructure kmem_cache_create() debug checks
authorShuah Khan <shuah.khan@hp.com>
Thu, 16 Aug 2012 07:09:46 +0000 (00:09 -0700)
committerPekka Enberg <penberg@kernel.org>
Thu, 16 Aug 2012 07:14:18 +0000 (10:14 +0300)
commit77be4b1366c97b95bb197e18187ff45b0e4f6bd3
treec1e86b43b7aeeb6b9f0364f8274b2726432b4a46
parentb920536aa0a4fd178b2957774adfe409027fe55b
mm/slab: restructure kmem_cache_create() debug checks

kmem_cache_create() does cache integrity checks when CONFIG_DEBUG_VM is
defined.  These checks interspersed with the regular code path has lead
to compile time warnings when compiled without CONFIG_DEBUG_VM defined.
Restructuring the code to move the integrity checks in to a new function
would eliminate the current compile warning problem and also will allow
for future changes to the debug only code to evolve without introducing
new warnings in the regular path.

This restructuring work is based on the discussion in the following
thread:

https://lkml.org/lkml/2012/7/13/424

[akpm@linux-foundation.org: fix build, cleanup]
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slab_common.c