linux/arch/hexagon/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
..
asm-offsets.h Hexagon: Add processor and system headers 2011-11-01 07:34:18 -07:00
atomic.h locking/atomic: Remove linux/atomic.h:atomic_fetch_or() 2016-06-16 10:48:32 +02:00
bitops.h arch,hexagon: Convert smp_mb__*() 2014-04-18 14:20:35 +02:00
cache.h Hexagon: set ARCH_DMA_MINALIGN 2014-12-16 13:27:30 -06:00
cacheflush.h hexagon: Fix build failures in linux-next 2014-12-16 13:27:12 -06:00
checksum.h ipv4: Update parameters for csum_tcpudp_magic to their original types 2016-03-13 23:55:13 -04:00
cmpxchg.h arch: Remove __ARCH_HAVE_CMPXCHG 2015-05-13 10:55:42 +02:00
delay.h arch: hexagon: kernel: add export symbol function __delay() 2014-04-04 18:19:59 -05:00
dma-mapping.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dma.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
elf.h Hexagon: update CR year for elf.h 2014-04-04 18:20:02 -05:00
exec.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
fixmap.h hexagon: use generic fixmap.h 2014-01-23 16:36:54 -08:00
fpu.h
futex.h
hexagon_vm.h hexagon: Fix misspellings in comments. 2016-04-18 12:45:54 +02:00
intrinsics.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
io.h hexagon: Fix build failures in linux-next 2014-12-16 13:27:12 -06:00
irq.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
irqflags.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
Kbuild Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2015-10-04 16:31:13 +01:00
kgdb.h hexagon: include: asm: kgdb: extend DBG_MAX_REG_NUM for "cs0/1" 2014-04-04 18:19:59 -05:00
linkage.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
mem-layout.h Hexagon: use correct translation for VMALLOC_START 2013-04-30 19:40:29 -05:00
mmu_context.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
mmu.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
module.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
mutex.h
page.h Hexagon: use correct translations for DMA mappings 2013-04-30 19:40:28 -05:00
perf_event.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
pgalloc.h tree wide: get rid of __GFP_REPEAT for order-0 allocations part I 2016-06-24 17:23:52 -07:00
pgtable.h mm: make FIRST_USER_ADDRESS unsigned long on all archs 2015-02-11 17:06:03 -08:00
processor.h arch, locking: Ciao arch_mutex_cpu_relax() 2014-07-17 12:32:47 +02:00
smp.h smp, hexagon: kill SMP single function call interrupt 2014-04-04 18:20:01 -05:00
spinlock_types.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
spinlock.h locking/spinlock, arch: Update and fix spin_unlock_wait() implementations 2016-06-14 11:55:15 +02:00
string.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
suspend.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
switch_to.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
syscall.h take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h 2012-11-28 23:43:27 -05:00
thread_info.h arch: Remove exec_domain from remaining archs 2015-04-12 21:03:30 +02:00
time.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
timer-regs.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
timex.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
tlb.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
tlbflush.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
traps.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
uaccess.h mm/uaccess, mm/fault: Clarify that uaccess may only sleep if pagefaults are enabled 2015-05-19 08:39:14 +02:00
vdso.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
vm_fault.h Hexagon: Copyright marking changes 2012-10-18 17:07:21 -05:00
vm_mmu.h hexagon: Fix misspellings in comments. 2016-04-18 12:45:54 +02:00