From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328AbdJSVWD (ORCPT ); Thu, 19 Oct 2017 17:22:03 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:52809 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbdJSVWC (ORCPT ); Thu, 19 Oct 2017 17:22:02 -0400 X-Google-Smtp-Source: ABhQp+TtUt+T7/q3bwwD3pI5771nKERtwlsY+2Ok6SLZZBszJq69F5IpDXcW3jHgXDfNQKE+SJOZug== From: Vasyl Gomonovych 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 Message-Id: <1508448108-21713-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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