linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
@ 2023-12-12  3:20 yang.guang5
  2023-12-13  8:26 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: yang.guang5 @ 2023-12-12  3:20 UTC (permalink / raw)
  To: linux
  Cc: jiang.xuexin, chen.haonan2, cgel.zte, rmk+kernel, willy,
	linus.walleij, rppt, jroedel, arnd, gregkh, jgg, linux-arm-kernel,
	linux-kernel

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(-)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
  2023-12-12  3:20 [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc() yang.guang5
@ 2023-12-13  8:26 ` Linus Walleij
  2023-12-13 14:39   ` chenguanxi11234
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2023-12-13  8:26 UTC (permalink / raw)
  To: yang.guang5
  Cc: linux, jiang.xuexin, chen.haonan2, cgel.zte, rmk+kernel, willy,
	rppt, jroedel, arnd, gregkh, jgg, linux-arm-kernel, linux-kernel

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
  2023-12-13  8:26 ` Linus Walleij
@ 2023-12-13 14:39   ` chenguanxi11234
  2023-12-14 13:17     ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: chenguanxi11234 @ 2023-12-13 14:39 UTC (permalink / raw)
  To: linus.walleij
  Cc: arnd, cgel.zte, chen.haonan2, gregkh, jgg, jiang.xuexin, jroedel,
	linux-arm-kernel, linux-kernel, linux, rmk+kernel, rppt, willy,
	yang.guang5

>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.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
  2023-12-13 14:39   ` chenguanxi11234
@ 2023-12-14 13:17     ` Linus Walleij
  2023-12-14 17:10       ` Russell King (Oracle)
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2023-12-14 13:17 UTC (permalink / raw)
  To: chenguanxi11234
  Cc: arnd, cgel.zte, chen.haonan2, gregkh, jgg, jiang.xuexin, jroedel,
	linux-arm-kernel, linux-kernel, linux, rmk+kernel, rppt, willy,
	yang.guang5

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc()
  2023-12-14 13:17     ` Linus Walleij
@ 2023-12-14 17:10       ` Russell King (Oracle)
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King (Oracle) @ 2023-12-14 17:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: chenguanxi11234, arnd, cgel.zte, chen.haonan2, gregkh, jgg,
	jiang.xuexin, jroedel, linux-arm-kernel, linux-kernel, rppt,
	willy, yang.guang5

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!

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-14 17:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12  3:20 [PATCH linux-next] ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc() yang.guang5
2023-12-13  8:26 ` Linus Walleij
2023-12-13 14:39   ` chenguanxi11234
2023-12-14 13:17     ` Linus Walleij
2023-12-14 17:10       ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).