[PATCH -next 00/26] treewide: Use dma_zalloc_coherent
STALE4423d
5 messages,
3 authors,
2014-06-23 · open the first message on its own page
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
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/video/fbdev/da8xx-fb.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index a8484f7..788f6b3 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c @@ -1447,18 +1447,15 @@ static int fb_probe(struct platform_device *device)
da8xx_fb_fix . line_length - 1 ;
/* allocate palette buffer */
- par -> v_palette_base = dma_alloc_coherent ( NULL ,
- PALETTE_SIZE ,
- ( resource_size_t * )
- & par -> p_palette_base ,
- GFP_KERNEL | GFP_DMA );
+ par -> v_palette_base = dma_zalloc_coherent ( NULL , PALETTE_SIZE ,
+ ( resource_size_t * ) & par -> p_palette_base ,
+ GFP_KERNEL | GFP_DMA );
if ( ! par -> v_palette_base ) {
dev_err ( & device -> dev ,
"GLCD: kmalloc for palette buffer failed \n " );
ret = - EINVAL ;
goto err_release_fb_mem ;
}
- memset ( par -> v_palette_base , 0 , PALETTE_SIZE );
par -> irq = platform_get_irq ( device , 0 );
if ( par -> irq < 0 ) { --
1.8.1.2.459.gbcd45b4.dirty
On Sun, Jun 15, 2014 at 10:37 PM, Joe Perches [off-list ref] wrote: quoted hunk diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index a8484f7..788f6b3 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c @@ -1447,18 +1447,15 @@ static int fb_probe(struct platform_device *device)
da8xx_fb_fix . line_length - 1 ;
/* allocate palette buffer */
- par -> v_palette_base = dma_alloc_coherent ( NULL ,
- PALETTE_SIZE ,
- ( resource_size_t * )
- & par -> p_palette_base ,
- GFP_KERNEL | GFP_DMA );
+ par -> v_palette_base = dma_zalloc_coherent ( NULL , PALETTE_SIZE ,
+ ( resource_size_t * ) & par -> p_palette_base ,
Suggestion for further cleanup: It seems this cast is no longer needed.
+ GFP_KERNEL | GFP_DMA);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On Mon, 2014-06-16 at 00:16 +0200, Geert Uytterhoeven wrote: On Sun, Jun 15, 2014 at 10:37 PM, Joe Perches [off-list ref] wrote: quoted diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c [] quoted @@ -1447,18 +1447,15 @@ static int fb_probe(struct platform_device *device)
da8xx_fb_fix.line_length - 1;
/* allocate palette buffer */
- par->v_palette_base = dma_alloc_coherent(NULL,
- PALETTE_SIZE,
- (resource_size_t *)
- &par->p_palette_base,
- GFP_KERNEL | GFP_DMA);
+ par->v_palette_base = dma_zalloc_coherent(NULL, PALETTE_SIZE,
+ (resource_size_t *)&par->p_palette_base,
Suggestion for further cleanup: It seems this cast is no longer needed.
Sure, but after this is applied.
On 15/06/14 23:37, Joe Perches wrote: quoted hunk Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/video/fbdev/da8xx-fb.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index a8484f7..788f6b3 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c @@ -1447,18 +1447,15 @@ static int fb_probe(struct platform_device *device)
da8xx_fb_fix . line_length - 1 ;
/* allocate palette buffer */
- par -> v_palette_base = dma_alloc_coherent ( NULL ,
- PALETTE_SIZE ,
- ( resource_size_t * )
- & par -> p_palette_base ,
- GFP_KERNEL | GFP_DMA );
+ par -> v_palette_base = dma_zalloc_coherent ( NULL , PALETTE_SIZE ,
+ ( resource_size_t * ) & par -> p_palette_base ,
+ GFP_KERNEL | GFP_DMA );
if ( ! par -> v_palette_base ) {
dev_err ( & device -> dev ,
"GLCD: kmalloc for palette buffer failed \n " );
ret = - EINVAL ;
goto err_release_fb_mem ;
}
- memset ( par -> v_palette_base , 0 , PALETTE_SIZE );
par -> irq = platform_get_irq ( device , 0 );
if ( par -> irq < 0 ) {
Thanks, queued for 3.17.
Tomi