* [PATCH -next 00/26] treewide: Use dma_zalloc_coherent @ 2014-06-15 20:37 Joe Perches 2014-06-15 20:37 ` [PATCH -next 01/26] powerpc: " Joe Perches 2014-06-15 20:37 ` [PATCH -next 26/26] sound: " Joe Perches 0 siblings, 2 replies; 4+ messages in thread From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw) To: linux-kernel Cc: linux-wireless, linux-fbdev, linux-scsi, linux-sh, linux-rdma, linux-arm-msm, dri-devel, linux-usb, linux-mmc, users, linux-nvme, linux-ide, ath10k, linux-crypto, netdev, dmaengine, wcn36xx, alsa-devel, linuxppc-dev, e1000-devel Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Joe Perches (26): powerpc: Use dma_zalloc_coherent sh: Use dma_zalloc_coherent ata: Use dma_zalloc_coherent block: Use dma_zalloc_coherent crypto: Use dma_zalloc_coherent dma: Use dma_zalloc_coherent gpu: Use dma_zalloc_coherent infiniband: Use dma_zalloc_coherent mmc: Use dma_zalloc_coherent broadcom: Use dma_zalloc_coherent hisilicon: Use dma_zalloc_coherent intel: Use dma_zalloc_coherent ath: Use dma_zalloc_coherent rt2x00: Use dma_zalloc_coherent bfa: Use dma_zalloc_coherent bnx2fc: Use dma_zalloc_coherent bnx2i: Use dma_zalloc_coherent dpt_i2o: Use dma_zalloc_coherent lpfc: Use dma_zalloc_coherent megaraid: Use dma_zalloc_coherent mvsas: Use dma_zalloc_coherent qla2xxx: Use dma_zalloc_coherent qla4xxx: Use dma_zalloc_coherent usb: Use dma_zalloc_coherent fbdev: Use dma_zalloc_coherent sound: Use dma_zalloc_coherent arch/powerpc/platforms/pasemi/dma_lib.c | 8 ++-- arch/powerpc/sysdev/fsl_rmu.c | 9 ++-- arch/sh/mm/consistent.c | 4 +- drivers/ata/sata_fsl.c | 5 +-- drivers/block/nvme-core.c | 5 +-- drivers/crypto/amcc/crypto4xx_core.c | 8 ++-- drivers/crypto/ixp4xx_crypto.c | 8 ++-- drivers/dma/imx-sdma.c | 5 +-- drivers/dma/mxs-dma.c | 8 ++-- drivers/gpu/drm/drm_pci.c | 6 +-- drivers/infiniband/hw/cxgb3/cxio_hal.c | 7 ++-- drivers/infiniband/hw/mthca/mthca_memfree.c | 5 +-- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 20 ++++----- drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 6 +-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++-- drivers/mmc/host/msm_sdcc.c | 8 ++-- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 +-- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 5 +-- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +-- drivers/net/wireless/ath/ath10k/pci.c | 8 +--- drivers/net/wireless/ath/ath10k/wmi.c | 8 +--- drivers/net/wireless/ath/wcn36xx/dxe.c | 6 +-- drivers/net/wireless/rt2x00/rt2x00mmio.c | 8 ++-- drivers/scsi/bfa/bfad_bsg.c | 6 +-- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 59 ++++++++++++--------------- drivers/scsi/bnx2fc/bnx2fc_tgt.c | 51 ++++++++++------------- drivers/scsi/bnx2i/bnx2i_hwi.c | 14 +++---- drivers/scsi/dpt_i2o.c | 19 ++++----- drivers/scsi/lpfc/lpfc_bsg.c | 5 +-- drivers/scsi/lpfc/lpfc_init.c | 22 ++++------ drivers/scsi/lpfc/lpfc_mbox.c | 6 +-- drivers/scsi/lpfc/lpfc_sli.c | 14 +++---- drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 ++-- drivers/scsi/mvsas/mv_init.c | 26 +++++------- drivers/scsi/qla2xxx/qla_init.c | 10 ++--- drivers/scsi/qla4xxx/ql4_init.c | 5 +-- drivers/scsi/qla4xxx/ql4_mbx.c | 21 ++++------ drivers/scsi/qla4xxx/ql4_nx.c | 5 +-- drivers/scsi/qla4xxx/ql4_os.c | 12 +++--- drivers/usb/dwc2/hcd_ddma.c | 20 ++++----- drivers/usb/host/uhci-hcd.c | 7 ++-- drivers/video/fbdev/da8xx-fb.c | 9 ++-- sound/aoa/soundbus/i2sbus/core.c | 12 ++---- sound/sparc/dbri.c | 6 +-- 44 files changed, 197 insertions(+), 308 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH -next 01/26] powerpc: Use dma_zalloc_coherent 2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches @ 2014-06-15 20:37 ` Joe Perches 2014-06-15 20:37 ` [PATCH -next 26/26] sound: " Joe Perches 1 sibling, 0 replies; 4+ messages in thread From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw) To: linux-kernel; +Cc: Olof Johansson, Paul Mackerras, linuxppc-dev Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <joe@perches.com> --- arch/powerpc/platforms/pasemi/dma_lib.c | 8 +++----- arch/powerpc/sysdev/fsl_rmu.c | 9 ++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c index aafa01ba..52b391f 100644 --- a/arch/powerpc/platforms/pasemi/dma_lib.c +++ b/arch/powerpc/platforms/pasemi/dma_lib.c @@ -255,15 +255,13 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size) chan->ring_size = ring_size; - chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev, - ring_size * sizeof(u64), - &chan->ring_dma, GFP_KERNEL); + chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev, + ring_size * sizeof(u64), + &chan->ring_dma, GFP_KERNEL); if (!chan->ring_virt) return -ENOMEM; - memset(chan->ring_virt, 0, ring_size * sizeof(u64)); - return 0; } EXPORT_SYMBOL(pasemi_dma_alloc_ring); diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index b48197a..34b49fc 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -744,15 +744,14 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries) } /* Initialize outbound message descriptor ring */ - rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev, - rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, - &rmu->msg_tx_ring.phys, GFP_KERNEL); + rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev, + rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, + &rmu->msg_tx_ring.phys, + GFP_KERNEL); if (!rmu->msg_tx_ring.virt) { rc = -ENOMEM; goto out_dma; } - memset(rmu->msg_tx_ring.virt, 0, - rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE); rmu->msg_tx_ring.tx_slot = 0; /* Point dequeue/enqueue pointers at first entry in ring */ -- 1.8.1.2.459.gbcd45b4.dirty ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next 26/26] sound: Use dma_zalloc_coherent 2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches 2014-06-15 20:37 ` [PATCH -next 01/26] powerpc: " Joe Perches @ 2014-06-15 20:37 ` Joe Perches 2014-06-16 9:40 ` Takashi Iwai 1 sibling, 1 reply; 4+ messages in thread From: Joe Perches @ 2014-06-15 20:37 UTC (permalink / raw) To: linux-kernel Cc: Takashi Iwai, Johannes Berg, linuxppc-dev, alsa-devel, Jaroslav Kysela Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <joe@perches.com> --- 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next 26/26] sound: Use dma_zalloc_coherent 2014-06-15 20:37 ` [PATCH -next 26/26] sound: " Joe Perches @ 2014-06-16 9:40 ` Takashi Iwai 0 siblings, 0 replies; 4+ messages in thread From: Takashi Iwai @ 2014-06-16 9:40 UTC (permalink / raw) To: Joe Perches Cc: Johannes Berg, linuxppc-dev, linux-kernel, alsa-devel, Jaroslav Kysela 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 > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-16 9:40 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-15 20:37 [PATCH -next 00/26] treewide: Use dma_zalloc_coherent Joe Perches 2014-06-15 20:37 ` [PATCH -next 01/26] powerpc: " Joe Perches 2014-06-15 20:37 ` [PATCH -next 26/26] sound: " Joe Perches 2014-06-16 9:40 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).