Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519319 > unrolled thread

[patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-11-10 20:40 +0100
Last post2016-11-11 09:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL Dan Carpenter <dan.carpenter@oracle.com> - 2016-11-10 20:40 +0100
    Re: [patch] usb: xhci-mem: use passed in GFP flags instead of  GFP_KERNEL Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-11-11 09:30 +0100

#1519319 — [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-11-10 20:40 +0100
Subject[patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
Message-ID<sC3mx-29W-25@gated-at.bofh.it>
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,

[toc] | [next] | [standalone]


#1519605 — Re: [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL

FromSebastian Andrzej Siewior <bigeasy@linutronix.de>
Date2016-11-11 09:30 +0100
SubjectRe: [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
Message-ID<sCfnH-1SI-15@gated-at.bofh.it>
In reply to#1519319
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web