From patchwork Thu Feb 8 17:58:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 10207657 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 A051F60247 for ; Thu, 8 Feb 2018 18:00:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB6F295F9 for ; Thu, 8 Feb 2018 18:00:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82F91295FC; Thu, 8 Feb 2018 18:00:19 +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, UNPARSEABLE_RELAY 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 075E1295F9 for ; Thu, 8 Feb 2018 18:00:19 +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:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=azrsDcZDJ7h+NWDGzBCjaX+NomUXjqCAm1jHHBpGdzc=; b=aLlPR7r8Qnumbb 3wqonwU0TY42hDoAHofc6tFHW9RGP9K+u2wlG4SidOuLwaVjDsHgvHc2kdLG3dDYZeqyx5UxG4nHi T4PYSDpjxDOaM5wbjJzle7C7EDlKDnzz9ohjbWb/XgCwbTItkLYMBDytWw8OQ8IwyKrQU4GTUziT2 7n3qJIy3hFDTnIKAtn4d/NlnTJolgbMV0c/hbyseB1gELyeOlfACFsVoha22ybKF9PXFzxh1im3tM vWiBK8/xvEqdeSjixtI3/Vpvvt0NzUW3ONaRYxL6fi0y87NxugTT53I57GK7R46+Nxdqybd4bdhYI bNndAUnD58RUXFWan/AQ==; 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 1ejqUX-00066i-7D; Thu, 08 Feb 2018 18:00:13 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejqTW-0004Kc-Ir; Thu, 08 Feb 2018 17:59:14 +0000 X-UUID: 06c08d010b2a4fe0ba7142859d50567f-20180209 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 971562605; Fri, 09 Feb 2018 01:58:58 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 9 Feb 2018 01:58:57 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 9 Feb 2018 01:58:57 +0800 From: To: , , , Subject: [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings Date: Fri, 9 Feb 2018 01:58:51 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N 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: devicetree@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, Julia Lawall , linux-mediatek@lists.infradead.org, dmaengine@vger.kernel.org, Fengguang Wu , 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: c8e4b2e4ca21 ("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 Signed-off-by: Sean Wang --- drivers/dma/mediatek/mtk-hsdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c index 42b5b23..d3b90fe 100644 --- 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 mtk_hsdma_device *hsdma, * 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); 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;