Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736393
| From | Thomas Meyer <thomas@m3y3r.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/6] mailbox: bcm-flexrm-mailbox: Cocci spatch "pool_zalloc-simple" |
| Date | 2017-09-21 08:30 +0200 |
| Message-ID | <us39M-5A5-19@gated-at.bofh.it> (permalink) |
| References | <us39M-5A5-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
Found by coccinelle spatch "api/alloc/pool_zalloc-simple.cocci"
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -1258,14 +1258,13 @@ static int flexrm_startup(struct mbox_ch
}
/* Allocate completion memory */
- ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool,
- GFP_KERNEL, &ring->cmpl_dma_base);
+ ring->cmpl_base = dma_pool_zalloc(ring->mbox->cmpl_pool, GFP_KERNEL,
+ &ring->cmpl_dma_base);
if (!ring->cmpl_base) {
dev_err(ring->mbox->dev, "can't allocate completion memory\n");
ret = -ENOMEM;
goto fail_free_bd_memory;
}
- memset(ring->cmpl_base, 0, RING_CMPL_SIZE);
/* Request IRQ */
if (ring->irq == UINT_MAX) {
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] Cocci spatch "pool_zalloc-simple" - v4.14-rc1 Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 08:30 +0200
[PATCH 1/6] mailbox: bcm-flexrm-mailbox: Cocci spatch "pool_zalloc-simple" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 08:30 +0200
[PATCH 5/6] scsi: qla2xxx: Cocci spatch "pool_zalloc-simple" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 08:30 +0200
Re: [PATCH 5/6] scsi: qla2xxx: Cocci spatch "pool_zalloc-simple" "Madhani, Himanshu" <Himanshu.Madhani@cavium.com> - 2017-09-22 19:30 +0200
Re: [PATCH 5/6] scsi: qla2xxx: Cocci spatch "pool_zalloc-simple" "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-09-26 01:10 +0200
[PATCH 4/6] mvsas: Cocci spatch "pool_zalloc-simple" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 08:30 +0200
csiph-web