linux/drivers/gpu/drm/msm
Krzysztof Kozlowski 00085f1efa dma-mapping: use unsigned long for dma_attrs
The dma-mapping core and the implementations do not change the DMA
attributes passed by pointer.  Thus the pointer can point to const data.
However the attributes do not have to be a bitfield.  Instead unsigned
long will do fine:

1. This is just simpler.  Both in terms of reading the code and setting
   attributes.  Instead of initializing local attributes on the stack
   and passing pointer to it to dma_set_attr(), just set the bits.

2. It brings safeness and checking for const correctness because the
   attributes are passed by value.

Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
     )

and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
     )

Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
Acked-by: Mark Salter <msalter@redhat.com> [c6x]
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris]
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm]
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp]
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core]
Acked-by: David Vrabel <david.vrabel@citrix.com> [xen]
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb]
Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32]
Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-08-04 08:50:07 -04:00
..
adreno drm/msm: deal with arbitrary # of cmd buffers 2016-07-16 10:09:08 -04:00
dsi drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode() 2016-07-16 10:29:28 -04:00
edp drm: msm: Rely on the default ->best_encoder() behavior where appropriate 2016-06-09 08:43:26 +02:00
hdmi drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" 2016-07-16 10:29:33 -04:00
mdp drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() 2016-07-16 10:29:34 -04:00
Kconfig drm: msm: Add ASoC generic hdmi audio codec support. 2016-07-16 10:29:00 -04:00
Makefile drm/msm: shrinker support 2016-07-16 10:09:06 -04:00
msm_atomic.c drm/atomic-helper: Massage swap_state signature somewhat 2016-06-10 16:52:12 +02:00
msm_debugfs.c drm/msm: move debugfs code to it's own file 2016-05-08 10:16:02 -04:00
msm_debugfs.h drm/msm: move debugfs code to it's own file 2016-05-08 10:16:02 -04:00
msm_drv.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
msm_drv.h drm/msm: wire up vmap shrinker 2016-07-16 10:09:07 -04:00
msm_fb.c drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() 2016-07-16 10:29:34 -04:00
msm_fbdev.c drm/msm: change gem->vmap() to get/put 2016-07-16 10:09:07 -04:00
msm_fence.c drm/msm: 'struct fence' conversion 2016-05-08 10:22:15 -04:00
msm_fence.h drm/msm: 'struct fence' conversion 2016-05-08 10:22:15 -04:00
msm_gem_prime.c drm/msm: change gem->vmap() to get/put 2016-07-16 10:09:07 -04:00
msm_gem_shrinker.c drm/msm: wire up vmap shrinker 2016-07-16 10:09:07 -04:00
msm_gem_submit.c drm/msm: deal with arbitrary # of cmd buffers 2016-07-16 10:09:08 -04:00
msm_gem.c drm/msm: Delete an unnecessary check before drm_gem_object_unreference() 2016-07-16 10:29:35 -04:00
msm_gem.h drm/msm: deal with arbitrary # of cmd buffers 2016-07-16 10:09:08 -04:00
msm_gpu.c drm/msm: print offender task name on hangcheck recovery 2016-05-08 10:22:18 -04:00
msm_gpu.h drm/msm: drop return from gpu->submit() 2016-05-08 10:22:18 -04:00
msm_iommu.c drm/msm: Print the correct virtual addresses in map/unmap funcs 2016-07-16 10:08:44 -04:00
msm_kms.h drm/msm/mdp5: Remove old kms init/destroy funcs 2016-07-16 10:08:57 -04:00
msm_mmu.h drm/msm: make iommu port names const'ier 2016-03-02 16:19:43 -05:00
msm_perf.c drm/msm: return -EFAULT instead of bytes remaining 2016-07-16 10:29:32 -04:00
msm_rd.c drm/msm: return -EFAULT instead of bytes remaining 2016-07-16 10:29:32 -04:00
msm_ringbuffer.c drm/msm: change gem->vmap() to get/put 2016-07-16 10:09:07 -04:00
msm_ringbuffer.h drm/msm: add a3xx gpu support 2013-08-24 14:57:18 -04:00
NOTES drm/msm: add mdp5/apq8x74 2014-01-09 14:44:06 -05:00