From patchwork Tue Jun 7 19:18:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitoj Kaur Chawla X-Patchwork-Id: 9162275 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 5949360572 for ; Tue, 7 Jun 2016 19:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B7292830C for ; Tue, 7 Jun 2016 19:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FE7028354; Tue, 7 Jun 2016 19:20:44 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3DD32830C for ; Tue, 7 Jun 2016 19:20:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAMWo-0008An-5d; Tue, 07 Jun 2016 19:19:06 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAMWm-00088W-18 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2016 19:19:04 +0000 Received: by mail-pf0-x243.google.com with SMTP id l188so4374456pfl.1 for ; Tue, 07 Jun 2016 12:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=ytWTJg/oQNaPXl9a2Q9RXbXY46SLolUikMy4n2yyWRk=; b=pqV0UdDfijSHLpz9jpUwhL0XMZmFRItN2LkUMCIrvarEpHeE5AVWflXIRXg+ZA8Urg 9/veD7oV5jjl4Uwvq+2k0tsZdi0jpsmFM/DTszCq3DTrt1+fzK5GUB7oDzk5yJc/U+Tg ImD5+P76eZbZ1HuqQ9rWHvR1st3s0Vcd3CZoF7TCO+8mhMQoFpqa8cfoOqCmKdzqFfYp 4ISDbB31f+oEn9XN/itarU8mIYLKFbwCMMQs6KLyqucolQ2vRtuEjRcAaOiL6dYSYtPl 7jbJBraNT1wz+FDrDQXn5zl/H2qclqg6lgHEAujelVvjjz5J70yW3sr6oF1N5fd2gdSA cuGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ytWTJg/oQNaPXl9a2Q9RXbXY46SLolUikMy4n2yyWRk=; b=RUM8oA1XMqR/yloJd4H2Sf+TCh8VFwBnxIFK2zR4ikDhhvIoOnEkeYHVv8lZbjXu2C 2WyYlD/r4a/+ESw7VrM6EX7rCj3gGdn7d9a2XrIO/N7ZMBe3DpktgOnwEtB+GgogJ9MH iGGa0mJLZarVeGTbNuLQMzwrYdJQDpJFayU1G2aSP5FM+iDIRQ8S335K7uCYNgmnheOK NYA8jYV8VG0nErfi9pBXu9Oe68+1FfF1xrPmd6e9o58HZJNaJZRIgds+6JyVwczffyB/ K7/3kCppUQe6gbd7ICk8o5aMCGCjvC38YoNWH5GPYNoV/49a6nexOw/PlGtfETph6sMg iDRw== X-Gm-Message-State: ALyK8tI6s7rl3jIaJkpBx70WxNWDGU6Qs0arI4mhrDj1q9WJj9SFTQVYYMRb3rf+JBriHQ== X-Received: by 10.98.86.151 with SMTP id h23mr1067541pfj.16.1465327122756; Tue, 07 Jun 2016 12:18:42 -0700 (PDT) Received: from localhost ([122.176.206.39]) by smtp.gmail.com with ESMTPSA id z184sm13968671pfz.6.2016.06.07.12.18.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 07 Jun 2016 12:18:42 -0700 (PDT) Date: Wed, 8 Jun 2016 00:48:38 +0530 From: Amitoj Kaur Chawla To: vinod.koul@intel.com, dan.j.williams@intel.com, michal.simek@xilinx.com, soren.brinkmann@xilinx.com, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: xilinx_vdma: Use dma_pool_zalloc Message-ID: <20160607191838.GA26841@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_121904_118922_9E7E401D X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: julia.lawall@lip6.fr 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 Dma_pool_zalloc combines dma_pool_alloc and memset 0. The Coccinelle semantic patch used to make this change is as follows: @@ type T; T *d; expression e; statement S; @@ d = - dma_pool_alloc + dma_pool_zalloc (...); if (!d) S - memset(d, 0, sizeof(T)); Signed-off-by: Amitoj Kaur Chawla --- drivers/dma/xilinx/xilinx_vdma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index ef67f27..d35317f 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c @@ -315,11 +315,10 @@ xilinx_vdma_alloc_tx_segment(struct xilinx_vdma_chan *chan) struct xilinx_vdma_tx_segment *segment; dma_addr_t phys; - segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys); + segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); if (!segment) return NULL; - memset(segment, 0, sizeof(*segment)); segment->phys = phys; return segment;