summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Haonan <chen.haonan2@zte.com.cn>2023-12-15 11:04:40 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-01-05 14:14:28 +0100
commitc17d8847c3bef9e4fe4aef34edecc29cee3cd06f (patch)
tree84d350bea2512762bb3afcae7275dbd09e9cda6c
parentARM: 9329/1: kasan: Use memblock_alloc_try_nid_raw for shadow page (diff)
downloadlinux-c17d8847c3bef9e4fe4aef34edecc29cee3cd06f.tar.xz
linux-c17d8847c3bef9e4fe4aef34edecc29cee3cd06f.zip
ARM: 9331/1: ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
using kvzalloc() simplifies the code by avoiding the use of different memory allocation functions for different situations, making the code more uniform and readable. Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/mm/dma-mapping.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 5409225b4abc..d688eac6dbc1 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -859,10 +859,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;