[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1639484247-75684-1-git-send-email-wangqing@vivo.com>
Date: Tue, 14 Dec 2021 04:17:22 -0800
From: Qing Wang <wangqing@...o.com>
To: Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH] arm: mm: use kvmalloc instead of kzalloc and vzalloc
From: Wang Qing <wangqing@...o.com>
fix kvmalloc.cocci warning:
arch/arm/mm/dma-mapping.c:1209:28-29: WARNING opportunity for kvmalloc
Signed-off-by: Wang Qing <wangqing@...o.com>
---
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 4b61541..0fa8801
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1206,10 +1206,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 = kvmalloc(array_size, GFP_KERNEL);
if (!pages)
return NULL;
--
2.7.4
Powered by blists - more mailing lists