From patchwork Sun Jun 15 20:37:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 359876 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7227D1400D2 for ; Mon, 16 Jun 2014 06:40:53 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 5F5A41A0B6C for ; Mon, 16 Jun 2014 06:40:53 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from smtprelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by lists.ozlabs.org (Postfix) with ESMTP id EC5E91A03BF for ; Mon, 16 Jun 2014 06:39:24 +1000 (EST) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 098F9C2136; Sun, 15 Jun 2014 20:39:23 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30, 2, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::::, RULES_HIT:41:355:379:541:800:960:973:982:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:4321:4384:4605:5007:6117:6119:6261:8603:9592:10004:10026:10848:11026:11232:11657:11658:11914:12043:12296:12438:12517:12519:12555:13311:13357:13523:13524, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-HE-Tag: truck07_6e64288b2932f X-Filterd-Recvd-Size: 2721 Received: from localhost.localdomain (pool-71-103-235-196.lsanca.fios.verizon.net [71.103.235.196]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Sun, 15 Jun 2014 20:39:18 +0000 (UTC) From: Joe Perches To: linux-kernel@vger.kernel.org Subject: [PATCH -next 26/26] sound: Use dma_zalloc_coherent Date: Sun, 15 Jun 2014 13:37:55 -0700 Message-Id: <1ee1f44142267688ea2db19c11a83596b98c4f17.1402863905.git.joe@perches.com> X-Mailer: git-send-email 1.8.1.2.459.gbcd45b4.dirty In-Reply-To: References: Cc: Takashi Iwai , Johannes Berg , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, Jaroslav Kysela X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches --- sound/aoa/soundbus/i2sbus/core.c | 12 ++++-------- sound/sparc/dbri.c | 6 ++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 4678360..a80d5ea 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -47,15 +47,11 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev, /* We use the PCI APIs for now until the generic one gets fixed * enough or until we get some macio-specific versions */ - r->space = dma_alloc_coherent( - &macio_get_pci_dev(i2sdev->macio)->dev, - r->size, - &r->bus_addr, - GFP_KERNEL); + r->space = dma_zalloc_coherent(&macio_get_pci_dev(i2sdev->macio)->dev, + r->size, &r->bus_addr, GFP_KERNEL); + if (!r->space) + return -ENOMEM; - if (!r->space) return -ENOMEM; - - memset(r->space, 0, r->size); r->cmds = (void*)DBDMA_ALIGN(r->space); r->bus_cmd_start = r->bus_addr + (dma_addr_t)((char*)r->cmds - (char*)r->space); diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index be1b1aa..b2c3d0d 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -2534,12 +2534,10 @@ static int snd_dbri_create(struct snd_card *card, dbri->op = op; dbri->irq = irq; - dbri->dma = dma_alloc_coherent(&op->dev, - sizeof(struct dbri_dma), - &dbri->dma_dvma, GFP_ATOMIC); + dbri->dma = dma_zalloc_coherent(&op->dev, sizeof(struct dbri_dma), + &dbri->dma_dvma, GFP_ATOMIC); if (!dbri->dma) return -ENOMEM; - memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", dbri->dma, dbri->dma_dvma);