lkml.org 
[lkml]   [2017]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mailbox: bcm-flexrm-mailbox: Fix dma_pool_zalloc instead of dma_pool_alloc/memset
Date
drivers/mailbox/bcm-flexrm-mailbox.c:1261:17-18: WARNING: *_pool_zalloc should be used for ring -> cmpl_base, instead of *_pool_alloc/memset

Generated by: scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
drivers/mailbox/bcm-flexrm-mailbox.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
index ae6146311934..b78e0cd6525b 100644
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -1258,14 +1258,13 @@ static int flexrm_startup(struct mbox_chan *chan)
}

/* Allocate completion memory */
- ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool,
+ 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) {
--
1.9.1
\
 
 \ /
  Last update: 2017-10-22 17:30    [W:0.032 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site