Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755134AbaFPJkZ (ORCPT ); Mon, 16 Jun 2014 05:40:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754704AbaFPJkY (ORCPT ); Mon, 16 Jun 2014 05:40:24 -0400 Date: Mon, 16 Jun 2014 11:40:22 +0200 Message-ID: From: Takashi Iwai To: Joe Perches Cc: linux-kernel@vger.kernel.org, Johannes Berg , Jaroslav Kysela , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org Subject: Re: [PATCH -next 26/26] sound: Use dma_zalloc_coherent In-Reply-To: <1ee1f44142267688ea2db19c11a83596b98c4f17.1402863905.git.joe@perches.com> References: <1ee1f44142267688ea2db19c11a83596b98c4f17.1402863905.git.joe@perches.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Sun, 15 Jun 2014 13:37:55 -0700, Joe Perches wrote: > > Use the zeroing function instead of dma_alloc_coherent & memset(,0,) > > Signed-off-by: Joe Perches Applied, thanks. Takashi > --- > 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); > -- > 1.8.1.2.459.gbcd45b4.dirty > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/