Skip to content

Commit

Permalink
slub: Reduce #ifdef ZONE_DMA by moving kmalloc_caches_dma near dma logic
Browse files Browse the repository at this point in the history
Move the definition of kmalloc_caches_dma() into a later #ifdef CONFIG_ZONE_DMA.
This saves one #ifdef and leaves us with a total of two #ifdefs for dma slab support.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Apr 14, 2008
1 parent 62f7553 commit 4097d60
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2412,10 +2412,6 @@ EXPORT_SYMBOL(kmem_cache_destroy);
struct kmem_cache kmalloc_caches[PAGE_SHIFT + 1] __cacheline_aligned;
EXPORT_SYMBOL(kmalloc_caches);

#ifdef CONFIG_ZONE_DMA
static struct kmem_cache *kmalloc_caches_dma[PAGE_SHIFT + 1];
#endif

static int __init setup_slub_min_order(char *str)
{
get_option(&str, &slub_min_order);
Expand Down Expand Up @@ -2475,6 +2471,7 @@ static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s,
}

#ifdef CONFIG_ZONE_DMA
static struct kmem_cache *kmalloc_caches_dma[PAGE_SHIFT + 1];

static void sysfs_add_func(struct work_struct *w)
{
Expand Down

0 comments on commit 4097d60

Please sign in to comment.