[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220615074146.912213-1-chi.minghao@zte.com.cn>
Date: Wed, 15 Jun 2022 07:41:46 +0000
From: cgel.zte@...il.com
To: linux@...linux.org.uk
Cc: logang@...tatee.com, martin.oliveira@...eticom.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] ARM: dma-mapping: Use kvzalloc in __iommu_alloc_buffer
From: Minghao Chi <chi.minghao@....com.cn>
Use kvzalloc() in __iommu_alloc_buffer() instead of open-coding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
arch/arm/mm/dma-mapping.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 82ffac621854..940819eda182 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1208,10 +1208,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;
--
2.25.1
Powered by blists - more mailing lists