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


Groups > linux.kernel > #1282364 > unrolled thread

[PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc

Started by"Geyslan G. Bem" <geyslan@gmail.com>
First post2015-12-02 21:50 +0100
Last post2015-12-04 17:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-02 21:50 +0100
    Re: [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with  dma_pool_zalloc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-12-04 17:30 +0100

#1282364 — [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc

From"Geyslan G. Bem" <geyslan@gmail.com>
Date2015-12-02 21:50 +0100
Subject[PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc
Message-ID<qBmvD-3Jz-15@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1283994 — Re: [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-12-04 17:30 +0100
SubjectRe: [PATCH 1/3] usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc
Message-ID<qC1pa-54b-65@gated-at.bofh.it>
In reply to#1282364
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web