From: Vasyl Gomonovych <gomonovych@gmail.com>
To: jassisinghbrar@gmail.com, linux-kernel@vger.kernel.org,
gomonovych@gmail.com
Subject: [PATCH] mailbox: bcm-flexrm-mailbox: Fix dma_pool_zalloc instead of dma_pool_alloc/memset
Date: Thu, 19 Oct 2017 23:21:48 +0200 [thread overview]
Message-ID: <1508448108-21713-1-git-send-email-gomonovych@gmail.com> (raw)
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
reply other threads:[~2017-10-19 21:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508448108-21713-1-git-send-email-gomonovych@gmail.com \
--to=gomonovych@gmail.com \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®