linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
@ 2016-11-10 19:33 Dan Carpenter
  2016-11-11  8:28 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-11-10 19:33 UTC (permalink / raw)
  To: Mathias Nyman, Sebastian Andrzej Siewior
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, kernel-janitors

We normally use the passed in gfp flags for allocations, it's just these
two which were missed.

Fixes: 22d45f01a836 ("usb/xhci: replace pci_*_consistent() with dma_*_coherent()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
>From static analysis.  Not tested.

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 6afe323..3c4cc29 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -2384,7 +2384,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
 	 * "physically contiguous and 64-byte (cache line) aligned".
 	 */
 	xhci->dcbaa = dma_alloc_coherent(dev, sizeof(*xhci->dcbaa), &dma,
-			GFP_KERNEL);
+			flags);
 	if (!xhci->dcbaa)
 		goto fail;
 	memset(xhci->dcbaa, 0, sizeof *(xhci->dcbaa));
@@ -2480,7 +2480,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
 
 	xhci->erst.entries = dma_alloc_coherent(dev,
 			sizeof(struct xhci_erst_entry) * ERST_NUM_SEGS, &dma,
-			GFP_KERNEL);
+			flags);
 	if (!xhci->erst.entries)
 		goto fail;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,

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

* Re: [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
  2016-11-10 19:33 [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL Dan Carpenter
@ 2016-11-11  8:28 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-11-11  8:28 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, linux-kernel,
	kernel-janitors

On 2016-11-10 22:33:17 [+0300], Dan Carpenter wrote:
> We normally use the passed in gfp flags for allocations, it's just these
> two which were missed.

You seem to be right. xhci_mem_init() has only one caller with
GFP_KERNEL as argument. You could unwind it.

Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

> Fixes: 22d45f01a836 ("usb/xhci: replace pci_*_consistent() with dma_*_coherent()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Sebastian

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

end of thread, other threads:[~2016-11-11  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 19:33 [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL Dan Carpenter
2016-11-11  8:28 ` Sebastian Andrzej Siewior

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