On Wed, 11 May 2011, David Rientjes wrote:
This generates a warning without CONFIG_SLUB_DEBUG:
mm/slub.c:335: warning: ‘get_map’ defined but not used
Subject: slub: Avoid warning for !CONFIG_SLUB_DEBUG
Move the #ifdef so that get_map is only defined if CONFIG_SLUB_DEBUG is defined.
Signed-off-by: Christoph Lameter <redacted>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-05-12 11:38:42.000000000 -0500
+++ linux-2.6/mm/slub.c 2011-05-12 11:39:40.000000000 -0500
@@ -326,6 +326,7 @@ static inline int oo_objects(struct kmem
return x.x & OO_MASK;
}
+#ifdef CONFIG_SLUB_DEBUG
/*
* Determine a map of object in use on a page.
*
@@ -341,7 +342,6 @@ static void get_map(struct kmem_cache *s
set_bit(slab_index(p, s, addr), map);
}
-#ifdef CONFIG_SLUB_DEBUG
/*
* Debug settings:
*/