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: 10198615 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 738DF603ED for ; Sat, 3 Feb 2018 16:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 620B528FD8 for ; Sat, 3 Feb 2018 16:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5635C28FDF; Sat, 3 Feb 2018 16:11:00 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EC32628FD8 for ; Sat, 3 Feb 2018 16:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=j2syLvs3P/xlNOYuMz+rwwtackzz9l7pIK5kxRtcvIo=; b=H/F7NQ27FFZ2WB ILVtsm+PilJe3vkI15PwyOReKm103Kc2ek46GFHNlqs0vAH0UdVQRJRPq2nSt0p3/aU4K3xgIwfrp WV28JQ9uXqS9aFZZRdbKNoso1d9bYbutjl0Z7rGbcrsM4mhMUq9RLhIKxEiYIeQhLh5EhITT2XdlQ J0FMEop8BGNGqwmp5z4Twm1iOSsNmmraJfXsEmoNN/MblWwPRxp2jCND2C+wnDGMQBfj7Tkxh6Ss3 KY9CjZOdPM8NoyalgmYV/2XYe0pUce4Dy/z+0ElpEw/QJKL1YFp/6CMsmqsJIos7yNapM84NGodHl 1BN3ct6f1SUMa7D2ZfOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ei0P2-0006Yq-Fl; Sat, 03 Feb 2018 16:10:56 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ei0On-0006Ne-KH; Sat, 03 Feb 2018 16:10:45 +0000 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 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 X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, vinod.koul@intel.com, Sean Wang , linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, kbuild-all@01.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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(-) --- 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;