diff mbox series

ARM/dma-mapping: use kvzalloc() in __iommu_alloc_buffer()

Message ID 20200827151541.39662-1-efremov@linux.com (mailing list archive)
State New, archived
Headers show
Series ARM/dma-mapping: use kvzalloc() in __iommu_alloc_buffer() | expand

Commit Message

Denis Efremov (Oracle) Aug. 27, 2020, 3:15 p.m. UTC
Use kvzalloc() in __iommu_alloc_buffer() instead of open-coding it.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 arch/arm/mm/dma-mapping.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 8a8949174b1c..9def10affa70 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1203,10 +1203,7 @@  static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,
 	int i = 0;
 	int order_idx = 0;
 
-	if (array_size <= PAGE_SIZE)
-		pages = kzalloc(array_size, GFP_KERNEL);
-	else
-		pages = vzalloc(array_size);
+	pages = kvzalloc(array_size, GFP_KERNEL);
 	if (!pages)
 		return NULL;