From: Qing Wang <wangqing@vivo.com>
To: Russell King <linux@armlinux.org.uk>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>
Subject: [PATCH] arm: mm: use kvmalloc instead of kzalloc and vzalloc
Date: Tue, 14 Dec 2021 04:17:22 -0800 [thread overview]
Message-ID: <1639484247-75684-1-git-send-email-wangqing@vivo.com> (raw)
From: Wang Qing <wangqing@vivo.com>
fix kvmalloc.cocci warning:
arch/arm/mm/dma-mapping.c:1209:28-29: WARNING opportunity for kvmalloc
Signed-off-by: Wang Qing <wangqing@vivo.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
reply other threads:[~2021-12-14 12:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1639484247-75684-1-git-send-email-wangqing@vivo.com \
--to=wangqing@vivo.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®