2023-12-12 03:21:04

by yang.guang5

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

From: Yang Guang <[email protected]>
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]>
---
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 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;

--
2.25.1


2023-12-13 08:26:50

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()

On Tue, Dec 12, 2023 at 4:20 AM <[email protected]> wrote:

> From: Yang Guang <[email protected]>
> 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]>

Looks good to me:
Reviewed-by: Linus Walleij <[email protected]>

Please put this patch into Russell's patch tracker.

Yours,
Linus Walleij

2023-12-13 14:42:32

by chenguanxi11234

[permalink] [raw]
Subject: Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()

>Looks good to me:
>Reviewed-by: Linus Walleij <[email protected]>
>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.

2023-12-14 13:18:16

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()

On Wed, Dec 13, 2023 at 3:41 PM <[email protected]> wrote:

> >Looks good to me:
> >Reviewed-by: Linus Walleij <[email protected]>
> >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

2023-12-14 17:12:13

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()

On Thu, Dec 14, 2023 at 02:17:51PM +0100, Linus Walleij wrote:
> On Wed, Dec 13, 2023 at 3:41 PM <[email protected]> wrote:
>
> > >Looks good to me:
> > >Reviewed-by: Linus Walleij <[email protected]>
> > >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!

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!