Skip to content

Commit c17d884

Browse files
Chen HaonanRussell King (Oracle)
authored andcommitted
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>
1 parent 89320c9 commit c17d884

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,
859859
int i = 0;
860860
int order_idx = 0;
861861

862-
if (array_size <= PAGE_SIZE)
863-
pages = kzalloc(array_size, GFP_KERNEL);
864-
else
865-
pages = vzalloc(array_size);
862+
pages = kvzalloc(array_size, GFP_KERNEL);
866863
if (!pages)
867864
return NULL;
868865

0 commit comments

Comments
 (0)