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: 10198613 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 2B59A603ED for ; Sat, 3 Feb 2018 16:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A77528FD8 for ; Sat, 3 Feb 2018 16:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EDBE28FDF; Sat, 3 Feb 2018 16:10:50 +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 40DDD28FD8 for ; Sat, 3 Feb 2018 16:10:49 +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=s7bU6tfQkWkYxaw5wLEA/ou/CxefFkFyFAYjN1k4dAg=; b=BNDxUixbS4Osim eTDgimmClna+VqKaCf3lM6TX26/VAxVpAYgEkDka/q9kFw1KjCxLQKPkYorhU4AFWL9mUgC1shoG6 WQbRxqfK8bj/a/btUnaUEKFSEyPinAQK6PHZbrGWApcBRTYXpAtp484fpZwQCA4inbje7scrlMelY gyLOjsxhugh6LLQ8uR9M+9t5yoKx6edtIIcmJeAqPX5ZCSWj/MCzw9AQLONmWfftdTHSG6gxFZKAp c+YyFHUMlPZfdIdi7UiYIxa9yv/0NkLLKhUPMi8KTnctFEiMmaf3zphx0FwDDo+2GtHmIN9lCWszC 7cEQ0ZO7QOfB7TPnPjUg==; 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 1ei0Ot-0006Nz-F1; Sat, 03 Feb 2018 16:10:47 +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-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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;