Skip to content

Commit

Permalink
slab: Only define slab_error for DEBUG
Browse files Browse the repository at this point in the history
On Tue, 11 Sep 2012, Stephen Rothwell wrote:
> After merging the final tree, today's linux-next build (sparc64 defconfig)
> produced this warning:
>
> mm/slab.c:808:13: warning: '__slab_error' defined but not used [-Wunused-function]
>
> Introduced by commit 945cf2b ("mm/sl[aou]b: Extract a common
> function for kmem_cache_destroy").  All uses of slab_error() are now
> guarded by DEBUG.

There is no use case left for slab builds without DEBUG.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and penberg committed Sep 19, 2012
1 parent 9df53b1 commit f28510d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ static void cache_estimate(unsigned long gfporder, size_t buffer_size,
*left_over = slab_size - nr_objs*buffer_size - mgmt_size;
}

#if DEBUG
#define slab_error(cachep, msg) __slab_error(__func__, cachep, msg)

static void __slab_error(const char *function, struct kmem_cache *cachep,
Expand All @@ -812,6 +813,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep,
function, cachep->name, msg);
dump_stack();
}
#endif

/*
* By default on NUMA we use alien caches to stage the freeing of
Expand Down

0 comments on commit f28510d

Please sign in to comment.