diff mbox series

[09/22] usb: cdns3: Don't use GFP_DMA when calling dma_alloc_coherent()

Message ID 20220219005221.634-10-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_alloc_coherent() allocates dma buffer with device's addressing
limitation in mind. It's redundent to specify GFP_DMA when calling
dma_alloc_coherent(). replace it with GFP_KERNEL.

[ 42.hyeyoo@gmail.com: Update changelog ]

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
---
 drivers/usb/cdns3/cdns3-gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Feb. 19, 2022, 7:09 a.m. UTC | #1
On Sat, Feb 19, 2022 at 08:52:08AM +0800, Baoquan He wrote:
> dma_alloc_coherent() allocates dma buffer with device's addressing
> limitation in mind. It's redundent to specify GFP_DMA when calling
> dma_alloc_coherent(). replace it with GFP_KERNEL.

Plase avoid the overly long line. The rest looks good.
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index f9af7ebe003d..c0937d3d663f 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -3203,7 +3203,7 @@  static int cdns3_gadget_start(struct cdns *cdns)
 
 	/* allocate memory for setup packet buffer */
 	priv_dev->setup_buf = dma_alloc_coherent(priv_dev->sysdev, 8,
-						 &priv_dev->setup_dma, GFP_DMA);
+						 &priv_dev->setup_dma, GFP_KERNEL);
 	if (!priv_dev->setup_buf) {
 		ret = -ENOMEM;
 		goto err2;