Skip to content

Commit

Permalink
ARM: 9331/1: ARM/dma-mapping: replace kzalloc() and vzalloc() with kv…
Browse files Browse the repository at this point in the history
…zalloc()

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 <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
  • Loading branch information
Chen Haonan authored and Russell King (Oracle) committed Jan 5, 2024
1 parent 89320c9 commit c17d884
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c17d884

Please sign in to comment.