From patchwork Sat Feb 3 16:00:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10198603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2AB10603ED for ; Sat, 3 Feb 2018 16:00:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D15628F5A for ; Sat, 3 Feb 2018 16:00:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1184A28FDE; Sat, 3 Feb 2018 16:00:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E34428F5A for ; Sat, 3 Feb 2018 16:00:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752414AbeBCQAr (ORCPT ); Sat, 3 Feb 2018 11:00:47 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:22787 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbeBCQAq (ORCPT ); Sat, 3 Feb 2018 11:00:46 -0500 X-IronPort-AV: E=Sophos;i="5.46,455,1511823600"; d="scan'208";a="253518078" Received: from abo-202-111-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.111.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2018 17:00:44 +0100 Date: Sat, 3 Feb 2018 17:00:44 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: sean.wang@mediatek.com cc: vinod.koul@intel.com, dan.j.williams@intel.com, robh+dt@kernel.org, mark.rutland@arm.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Wang , kbuild-all@01.org Subject: [PATCH] dmaengine: mediatek: fix zalloc-simple.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fengguang Wu Use zeroing allocator rather than allocator followed by memset with 0 Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci Fixes: 73006a033ef0 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC") CC: Sean Wang Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- [auto build test WARNING on linus/master] [also build test WARNING on v4.15 next-20180202] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/sean-wang-mediatek-com/dt-bindings-dmaengine-Add-MediaTek-High-Speed-DMA-controller-bindings/20180203-203814 Please take the patch only if it's a positive warning. Thanks! mtk-hsdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/dma/mediatek/mtk-hsdma.c +++ b/drivers/dma/mediatek/mtk-hsdma.c @@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring. */ pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd); - ring->txd = dma_alloc_coherent(hsdma2dev(hsdma), - pc->sz_ring, &ring->tphys, - GFP_ATOMIC | __GFP_ZERO); + ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring, + &ring->tphys, GFP_ATOMIC | __GFP_ZERO); if (!ring->txd) return -ENOMEM; - memset(ring->txd, 0, pc->sz_ring); ring->rxd = &ring->txd[MTK_DMA_SIZE]; ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd); ring->cur_tptr = 0;