From: Takashi Iwai <tiwai@suse.de>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>,
Jaroslav Kysela <perex@perex.cz>,
linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH -next 26/26] sound: Use dma_zalloc_coherent
Date: Mon, 16 Jun 2014 11:40:22 +0200 [thread overview]
Message-ID: <s5hr42pdwft.wl%tiwai@suse.de> (raw)
In-Reply-To: <1ee1f44142267688ea2db19c11a83596b98c4f17.1402863905.git.joe@perches.com>
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 <joe@perches.com>
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
>
prev parent reply other threads:[~2014-06-16 9:40 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-15 20:37 [PATCH -next 00/26] treewide: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 01/26] powerpc: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 02/26] sh: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 03/26] ata: " Joe Perches
2014-06-17 14:23 ` Tejun Heo
2014-06-15 20:37 ` [PATCH -next 04/26] block: " Joe Perches
2014-06-28 12:52 ` Matthew Wilcox
2014-06-15 20:37 ` [PATCH -next 05/26] crypto: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 06/26] dma: " Joe Perches
2014-07-14 17:00 ` Vinod Koul
2014-06-15 20:37 ` [PATCH -next 07/26] gpu: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 08/26] infiniband: " Joe Perches
2014-06-16 13:20 ` Steve Wise
2014-06-15 20:37 ` [PATCH -next 09/26] mmc: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 10/26] broadcom: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 11/26] hisilicon: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 12/26] intel: " Joe Perches
2014-06-16 21:15 ` Jeff Kirsher
2014-06-15 20:37 ` [PATCH -next 13/26] ath: " Joe Perches
2014-06-16 9:24 ` Kalle Valo
2014-06-15 20:37 ` [PATCH -next 14/26] rt2x00: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 15/26] bfa: " Joe Perches
2014-06-16 6:31 ` Anil Gurumurthy
2014-06-15 20:37 ` [PATCH -next 16/26] bnx2fc: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 17/26] bnx2i: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 18/26] dpt_i2o: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 19/26] lpfc: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 20/26] megaraid: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 21/26] mvsas: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 22/26] qla2xxx: " Joe Perches
2014-06-16 6:16 ` Saurav Kashyap
2014-06-15 20:37 ` [PATCH -next 23/26] qla4xxx: " Joe Perches
2014-06-15 20:37 ` [PATCH -next 24/26] usb: " Joe Perches
2014-06-15 22:02 ` Alan Stern
2014-06-15 23:32 ` Joe Perches
2014-06-16 22:00 ` Paul Zimmerman
2014-06-17 0:30 ` Joe Perches
2014-06-15 20:37 ` [PATCH -next 25/26] fbdev: " Joe Perches
2014-06-15 22:16 ` Geert Uytterhoeven
2014-06-15 23:32 ` Joe Perches
2014-06-23 11:53 ` Tomi Valkeinen
2014-06-15 20:37 ` [PATCH -next 26/26] sound: " Joe Perches
2014-06-16 9:40 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hr42pdwft.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=joe@perches.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome