diff mbox series

[linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()

Message ID 202312121120348064534@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series [linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc() | expand

Commit Message

yang.guang5@zte.com.cn Dec. 12, 2023, 3:20 a.m. UTC
From: Yang Guang <yang.guang5@zte.com.cn>
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>
---
 arch/arm/mm/dma-mapping.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Linus Walleij Dec. 13, 2023, 8:26 a.m. UTC | #1
On Tue, Dec 12, 2023 at 4:20 AM <yang.guang5@zte.com.cn> wrote:

> From: Yang Guang <yang.guang5@zte.com.cn>
> 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>

Looks good to me:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Please put this patch into Russell's patch tracker.

Yours,
Linus Walleij
chenguanxi11234@163.com Dec. 13, 2023, 2:39 p.m. UTC | #2
>Looks good to me:
>Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>Please put this patch into Russell's patch tracker.

Hello, I would like to ask, do you mean to have 
me CC the patch email to Russell?I don't really 
understand what patch tracker means.Thank you.
Linus Walleij Dec. 14, 2023, 1:17 p.m. UTC | #3
On Wed, Dec 13, 2023 at 3:41 PM <chenguanxi11234@163.com> wrote:

> >Looks good to me:
> >Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >Please put this patch into Russell's patch tracker.
>
> Hello, I would like to ask, do you mean to have
> me CC the patch email to Russell?I don't really
> understand what patch tracker means.Thank you.

This is Russell's patch tracker:
https://www.armlinux.org.uk/developer/patches/

Create an account, read the help text, you can submit patches
using a web interface or through mail.

Yours,
Linus Walleij
Russell King (Oracle) Dec. 14, 2023, 5:10 p.m. UTC | #4
On Thu, Dec 14, 2023 at 02:17:51PM +0100, Linus Walleij wrote:
> On Wed, Dec 13, 2023 at 3:41 PM <chenguanxi11234@163.com> wrote:
> 
> > >Looks good to me:
> > >Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > >Please put this patch into Russell's patch tracker.
> >
> > Hello, I would like to ask, do you mean to have
> > me CC the patch email to Russell?I don't really
> > understand what patch tracker means.Thank you.
> 
> This is Russell's patch tracker:
> https://www.armlinux.org.uk/developer/patches/
> 
> Create an account, read the help text, you can submit patches
> using a web interface or through mail.

No need to create an account if submitting by email, that will happen
automatically on the successful receipt of a patch, except of course
with password access blocked until a "forgotten password" thing is
done.

However, well worth reading the bit about adding a KernelVersion: tag
somewhere in the email!
diff mbox series

Patch

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;