Skip to contentSkip to conversation

usb: whci: replace dma_pool_alloc and memset with dma_pool_zalloc

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

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 usb: whci: 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/whci/qset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/host/whci/qset.c +1 -2
index dc31c42..3297473 100644
@@ -30,10 +30,9 @@ struct whc_qset *qset_alloc(struct whc *whc, gfp_t mem_flags)
 	struct whc_qset *qset;
 	dma_addr_t dma;
 
-	qset = dma_pool_alloc(whc->qset_pool, mem_flags, &dma);
+	qset = dma_pool_zalloc(whc->qset_pool, mem_flags, &dma);
 	if (qset == NULL)
 		return NULL;
-	memset(qset, 0, sizeof(struct whc_qset));
 
 	qset->qset_dma = dma;
 	qset->whc = whc;
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/whci/qset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

This, and patch 3/3 were also already done by someone else :(

#2 lore raw

2015-12-04 13:25 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 11 lines · Geyslan G. Bem
Quoted 8 lines

Replace dma_pool_alloc and memset with a single call to dma_pool_zalloc.

Caught by coccinelle.

---
 drivers/usb/host/whci/qset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

This, and patch 3/3 were also already done by someone else :(

I see. No problem at all.

If you wish, you could list me subsystems in need of maintenance.

Thanks.

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#3 lore raw
Quoted 2 lines · Geyslan G. Bem

If you wish, you could list me subsystems in need of maintenance.

I don't understand what you mean by this.

#4 lore raw

2015-12-04 13:44 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 5 lines · Geyslan G. Bem
Quoted 2 lines

If you wish, you could list me subsystems in need of maintenance.

I don't understand what you mean by this.

I meant that would be great to know which usb subsystems you do prefer that I continue cleaning/refactoring or if any would be ok. :)

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#5 lore raw
Quoted 9 lines · Geyslan G. Bem

2015-12-04 13:44 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 5 lines · Geyslan G. Bem
Quoted 2 lines

If you wish, you could list me subsystems in need of maintenance.

I don't understand what you mean by this.

I meant that would be great to know which usb subsystems you do prefer that I continue cleaning/refactoring or if any would be ok. :)

Any part of the drivers/usb/* tree that you find needs cleanups and fixes like these are great to do, please send patches for this, I'll gladly take them.

thanks,

gre k-h

#6 lore raw

2015-12-04 14:18 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 6 lines · Geyslan G. Bem
Quoted 5 lines

2015-12-04 13:44 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 4 lines · Geyslan G. Bem
Quoted 2 lines

If you wish, you could list me subsystems in need of maintenance.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I don't understand what you mean by this.

I meant that would be great to know which usb subsystems you do prefer that I continue cleaning/refactoring or if any would be ok. :)

Any part of the drivers/usb/* tree that you find needs cleanups and fixes like these are great to do, please send patches for this, I'll gladly take them.

Nice, I'll indeed.

Thanks.

Quoted 4 lines

thanks,

gre k-h

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com