2022-02-19 01:17:40

by Baoquan He

[permalink] [raw]
Subject: [PATCH 17/22] net: marvell: prestera: Don't use GFP_DMA when calling dma_pool_alloc()

dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer,
so it's redundent to specify GFP_DMA when calling.

Signed-off-by: Baoquan He <[email protected]>
---
drivers/net/ethernet/marvell/prestera/prestera_rxtx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c
index e452cdeaf703..9f32dcabefb9 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c
@@ -116,7 +116,7 @@ static int prestera_sdma_buf_init(struct prestera_sdma *sdma,
struct prestera_sdma_desc *desc;
dma_addr_t dma;

- desc = dma_pool_alloc(sdma->desc_pool, GFP_DMA | GFP_KERNEL, &dma);
+ desc = dma_pool_alloc(sdma->desc_pool, GFP_KERNEL, &dma);
if (!desc)
return -ENOMEM;

--
2.17.2


2022-02-19 11:00:31

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 17/22] net: marvell: prestera: Don't use GFP_DMA when calling dma_pool_alloc()

On Sat, Feb 19, 2022 at 08:52:16AM +0800, Baoquan He wrote:
> dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer,
> so it's redundent to specify GFP_DMA when calling.

Looks good:

Reviewed-by: Christoph Hellwig <[email protected]>

2022-02-21 07:57:40

by Baoquan He

[permalink] [raw]
Subject: Re: [PATCH 17/22] net: marvell: prestera: Don't use GFP_DMA when calling dma_pool_alloc()

On 02/18/22 at 08:54pm, Jakub Kicinski wrote:
> On Sat, 19 Feb 2022 08:52:16 +0800 Baoquan He wrote:
> > dma_pool_alloc() uses dma_alloc_coherent() to pre-allocate DMA buffer,
> > so it's redundent to specify GFP_DMA when calling.
> >
> > Signed-off-by: Baoquan He <[email protected]>
>
> This and the other two netdev patches in the series are perfectly
> cleanups reasonable even outside of the larger context.
>
> Please repost those separately and make sure you CC the maintainers
> of the drivers.

Thanks for reviewing. I am not familiar with netdev and network patch
posting rule. There are 4 patches altogether related to netdev as below,
Will repost them to the relevant netdev mailinglist and maintainers.

[PATCH 19/22] ethernet: rocker: Use dma_alloc_noncoherent() for dma buffer
[PATCH 18/22] net: ethernet: mtk-star-emac: Don't use GFP_DMA when calling dmam_alloc_coherent()
[PATCH 17/22] net: marvell: prestera: Don't use GFP_DMA when calling dma_pool_alloc()
[PATCH 02/22] net: moxa: Don't use GFP_DMA when calling dma_alloc_coherent()