linux/arch/c6x/include/asm
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
..
Kbuild Merge branch 'for-linux-next' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming 2016-01-12 13:00:16 -08:00
asm-offsets.h C6X: headers 2011-10-06 19:48:20 -04:00
bitops.h arch,c6x: Convert smp_mb__*() 2014-04-18 11:40:34 +02:00
bug.h Disintegrate asm/system.h for C6X 2012-03-28 18:30:02 +01:00
cache.h c6x: fix build failure caused by cache.h 2014-03-04 17:21:58 -05:00
cacheflush.h C6X: cache control 2011-10-06 19:48:10 -04:00
checksum.h ipv4: Update parameters for csum_tcpudp_magic to their original types 2016-03-13 23:55:13 -04:00
clock.h c6x: Fix misspellings in comments. 2016-04-18 12:45:53 +02:00
cmpxchg.h locking/cmpxchg, arch: Remove tas() definitions 2015-12-04 11:39:51 +01:00
delay.h C6X: headers 2011-10-06 19:48:20 -04:00
dma-mapping.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dscr.h C6X: DSCR - Device State Configuration Registers 2011-10-06 19:48:36 -04:00
elf.h default SET_PERSONALITY() in linux/elf.h 2013-02-26 02:46:08 -05:00
flat.h c6x: asm: Add default flat.h according to xtensa architecture 2015-03-26 10:31:48 -04:00
ftrace.h C6X: headers 2011-10-06 19:48:20 -04:00
hardirq.h C6X: interrupt handling 2011-10-06 19:47:54 -04:00
irq.h C6X: remove dependence on legacy IRQs 2012-07-18 23:49:40 -04:00
irqflags.h add memory barrier to arch_local_irq_restore 2013-04-09 15:35:46 -04:00
linkage.h C6X: headers 2011-10-06 19:48:20 -04:00
megamod-pic.h C6X: interrupt handling 2011-10-06 19:47:54 -04:00
module.h Make most arch asm/module.h files use asm-generic/module.h 2012-09-28 14:31:03 +09:30
mutex.h C6X: headers 2011-10-06 19:48:20 -04:00
page.h C6X: headers 2011-10-06 19:48:20 -04:00
pgtable.h arch/c6x/include/asm/pgtable.h: define dummy pgprot_writecombine for !MMU 2015-03-12 18:46:08 -07:00
processor.h arch, locking: Ciao arch_mutex_cpu_relax() 2014-07-17 12:32:47 +02:00
procinfo.h C6X: headers 2011-10-06 19:48:20 -04:00
ptrace.h UAPI: (Scripted) Disintegrate arch/c6x/include/asm 2012-10-09 14:56:38 -04:00
sections.h C6X: headers 2011-10-06 19:48:20 -04:00
setup.h c6x: include: asm: setup: Include "linux/types.h" 2015-03-26 10:39:46 -04:00
soc.h C6X: general SoC support 2011-10-06 19:48:26 -04:00
special_insns.h Disintegrate asm/system.h for C6X 2012-03-28 18:30:02 +01:00
string.h C6X: headers 2011-10-06 19:48:20 -04:00
switch_to.h Disintegrate asm/system.h for C6X 2012-03-28 18:30:02 +01:00
syscall.h C6X: headers 2011-10-06 19:48:20 -04:00
syscalls.h c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone() 2012-11-28 23:43:39 -05:00
thread_info.h arch: Remove exec_domain from remaining archs 2015-04-12 21:03:30 +02:00
timer64.h C6X: time management 2011-10-06 19:47:51 -04:00
timex.h C6X: time management 2011-10-06 19:47:51 -04:00
tlb.h C6X: headers 2011-10-06 19:48:20 -04:00
traps.h C6X: build infrastructure 2011-10-06 19:48:02 -04:00
uaccess.h C6X: headers 2011-10-06 19:48:20 -04:00
unaligned.h C6X: headers 2011-10-06 19:48:20 -04:00