Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b55f620 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

SLUB: Simplify dma index -> size calculation



There is no need to caculate the dma slab size ourselves. We can simply
lookup the size of the corresponding non dma slab.

Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f1b26339
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -2289,15 +2289,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
	if (!x)
		panic("Unable to allocate memory for dma cache\n");

	if (index <= KMALLOC_SHIFT_HIGH)
		realsize = 1 << index;
	else {
		if (index == 1)
			realsize = 96;
		else
			realsize = 192;
	}

	realsize = kmalloc_caches[index].objsize;
	text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d",
			(unsigned int)realsize);
	s = create_kmalloc_cache(x, text, realsize, flags);