diff mbox series

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

Message ID 20220219005221.634-18-bhe@redhat.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series Don't use kmalloc() with GFP_DMA | expand

Commit Message

Baoquan He Feb. 19, 2022, 12:52 a.m. UTC
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 <bhe@redhat.com>
---
 drivers/net/ethernet/marvell/prestera/prestera_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Feb. 19, 2022, 4:54 a.m. UTC | #1
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 <bhe@redhat.com>

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.
Christoph Hellwig Feb. 19, 2022, 7:13 a.m. UTC | #2
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 <hch@lst.de>
Baoquan He Feb. 20, 2022, 2:06 a.m. UTC | #3
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 <bhe@redhat.com>
> 
> 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()
diff mbox series

Patch

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;