linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc
@ 2015-12-02 20:41 Geyslan G. Bem
  2015-12-04 16:25 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2015-12-02 20:41 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc.

Caught by coccinelle.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/uhci-q.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index da6f56d..c17ea15 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -248,11 +248,10 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
 	dma_addr_t dma_handle;
 	struct uhci_qh *qh;
 
-	qh = dma_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
+	qh = dma_pool_zalloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
 	if (!qh)
 		return NULL;
 
-	memset(qh, 0, sizeof(*qh));
 	qh->dma_handle = dma_handle;
 
 	qh->element = UHCI_PTR_TERM(uhci);
-- 
2.6.2


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

* Re: [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc
  2015-12-02 20:41 [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc Geyslan G. Bem
@ 2015-12-04 16:25 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-12-04 16:25 UTC (permalink / raw)
  To: Geyslan G. Bem; +Cc: peter.senna, Alan Stern, linux-usb, linux-kernel

On Wed, Dec 02, 2015 at 05:41:44PM -0300, Geyslan G. Bem wrote:
> Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc.
> 
> Caught by coccinelle.
> 
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
>  drivers/usb/host/uhci-q.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

This is already in my tree, it was done by someone else before you,
sorry about that :(

greg k-h

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

end of thread, other threads:[~2015-12-04 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 20:41 [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc Geyslan G. Bem
2015-12-04 16:25 ` Greg Kroah-Hartman

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