Skip to contentSkip to conversation

usb: uhci: replace dma_pool_alloc and memset with dma_pool_zalloc

PATCH In review Geyslan G. Bem 2 participants 2 messages Dec 2, 2015 – Dec 4, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc.

Caught by coccinelle.

---
 drivers/usb/host/uhci-q.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/host/uhci-q.c +1 -2
index da6f56d..c17ea15 100644
@@ -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);
Signature · 1 line
2.6.2
#1 lore raw
Quoted 8 lines · Geyslan G. Bem

Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc.

Caught by coccinelle.

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