[PATCH 1/1] ARM: dma-mapping: Use only kzalloc without vzalloc

From: Hiroshi Doyu
Date: Wed Aug 22 2012 - 09:25:54 EST


Use only kzalloc for atomic allocation.

Signed-off-by: Hiroshi Doyu <hdoyu@xxxxxxxxxx>
---
arch/arm/mm/dma-mapping.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 4656c0f..d4f1cf2 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1083,10 +1083,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,
int count = size >> PAGE_SHIFT;
int array_size = count * sizeof(struct page *);

- if (array_size <= PAGE_SIZE)
- pages = kzalloc(array_size, gfp);
- else
- pages = vzalloc(array_size);
+ pages = kzalloc(array_size, gfp);
if (!pages)
return NULL;

@@ -1107,10 +1104,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,

return pages;
error:
- if (array_size <= PAGE_SIZE)
- kfree(pages);
- else
- vfree(pages);
+ kfree(pages);
return NULL;
}

--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/