linux/arch/microblaze/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 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2015-10-04 16:31:13 +01:00
asm-compat.h microblaze: Copy ppc asm-compat.h for clean handling of constants in asm and C 2009-09-22 10:10:06 +02:00
asm-offsets.h kbuild: move asm-offsets.h to include/generated 2009-12-12 13:08:14 +01:00
atomic.h atomic: implement generic atomic_dec_if_positive() 2012-10-09 16:22:46 +09:00
bitops.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
bug.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
bugs.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
cache.h microblaze: Define correct L1_CACHE_SHIFT value 2010-05-06 11:21:59 +02:00
cacheflush.h microblaze: Use static inline functions in cacheflush.h 2013-06-03 11:33:23 +02:00
checksum.h ipv4: Update parameters for csum_tcpudp_magic to their original types 2016-03-13 23:55:13 -04:00
cmpxchg.h microblaze: Add missing headers caused by disintegration asm/system.h 2012-03-30 12:11:46 +02:00
cpuinfo.h microblaze: Add support for CCF 2014-01-27 11:24:55 +01:00
cputable.h
current.h microblaze_mmu_v2: Add CURRENT_TASK for entry.S 2009-05-26 16:45:19 +02:00
delay.h microblaze: Change extern inline to static inline 2015-01-05 12:36:44 +01:00
div64.h
dma-mapping.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dma.h microblaze: Add isa_dma_bridge_buggy to dma.h 2010-05-06 11:21:58 +02:00
elf.h UAPI: (Scripted) Disintegrate arch/microblaze/include/asm 2012-12-13 14:38:55 +01:00
emergency-restart.h
entry.h arch/microblaze/include/asm/entry.h: Include "linux/linkage.h" to avoid compiling issue 2014-09-09 13:10:20 +02:00
exceptions.h microblaze: Fix sparse warning - fault.c 2011-03-09 08:09:59 +01:00
fb.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
fixmap.h microblaze: use generic fixmap.h 2014-01-23 16:36:54 -08:00
flat.h microblaze: remove unused flat_stack_align() definition 2009-06-02 07:54:36 +02:00
ftrace.h ftrace: Format MCOUNT_ADDR address as type unsigned long 2015-07-20 22:30:53 -04:00
futex.h microblaze: Reversed logic in futex cmpxchg 2013-05-27 12:29:35 +02:00
hardirq.h irq_domain/microblaze: Convert microblaze to use irq_domains 2012-02-16 06:11:24 -07:00
hash.h microblaze: Add <asm/hash.h> 2016-05-28 15:48:58 -04:00
highmem.h kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
hw_irq.h
io.h video/fbdev, asm/io.h: Remove ioremap_writethrough() 2015-06-07 15:28:57 +02:00
irq.h irq_domain/microblaze: Convert microblaze to use irq_domains 2012-02-16 06:11:24 -07:00
irq_regs.h
irqflags.h microblaze/irqs: Do not trace arch_local_{*,irq_*} functions 2011-07-25 09:07:45 +02:00
kdebug.h
kgdb.h microblaze: Declare microblaze_kgdb_break in header 2015-01-05 12:36:42 +01:00
kmap_types.h kmap_types: make most arches use generic header file 2009-06-16 19:47:51 -07:00
linkage.h microblaze: Use empty asm-generic/linkage.h 2015-01-05 12:36:39 +01:00
local.h
local64.h arch: Implement local64_t 2010-06-09 11:12:36 +02:00
mmu.h microblaze: Handle TLB skip size dynamically 2012-03-23 09:28:19 +01:00
mmu_context.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
mmu_context_mm.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
module.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
mutex.h
page.h mm/microblaze: clean up unused VALID_PAGE() 2013-07-03 16:07:40 -07:00
parport.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
pci-bridge.h microblaze/PCI: remove unused pci_flags 2012-02-23 20:18:57 -07:00
pci.h PCI: Unify pci_resource_to_user() declarations 2016-06-17 14:43:34 -05:00
percpu.h
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 exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
prom.h of: remove HAVE_ARCH_DEVTREE_FIXUPS 2013-10-09 20:04:08 -05:00
ptrace.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-20 18:05:28 -08:00
pvr.h microblaze: Unprivileged stream instruction awareness 2011-07-25 09:13:42 +02:00
registers.h microblaze_mmu_v2: Update process creation for MMU 2009-05-26 16:45:18 +02:00
seccomp.h microblaze: use asm-generic for seccomp.h 2015-04-17 09:04:10 -04:00
sections.h microblaze: Remove duplicate declarations of _stext[] and _etext[] 2014-01-21 08:28:19 +01:00
serial.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
setup.h microblaze: Drop architecture-specific declaration of early_printk 2014-03-12 10:10:07 +01:00
shmparam.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
string.h microblaze: Guard __HAVE_ARCH macros with __KERNEL__ in string.h 2009-05-21 15:56:08 +02:00
switch_to.h Disintegrate asm/system.h for Microblaze 2012-03-28 18:30:02 +01:00
syscall.h microblaze: Use unsigned return type in do_syscall_trace_enter 2015-01-05 12:36:43 +01:00
thread_info.h signal: consolidate {TS,TLF}_RESTORE_SIGMASK code 2016-08-02 19:35:23 -04:00
timex.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
tlb.h mmu_gather: move minimal range calculations into generic code 2014-11-17 10:12:42 +00:00
tlbflush.h microblaze: Fix TLB macros 2010-04-01 08:38:24 +02:00
topology.h of: Provide default of_node_to_nid() implementation. 2010-07-30 00:03:58 -06: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
ucontext.h microblaze: fall back on generic header files for the ABI 2009-07-06 10:26:50 +02:00
unaligned.h microblaze: Fix unaligned.h for endians 2011-03-09 08:09:53 +01:00
unistd.h microblaze: Wire up userfaultfd, membarrier, mlock2 syscalls 2016-05-16 09:18:01 +02:00
unwind.h microblaze: Add stack unwinder 2010-08-04 10:22:35 +02:00
user.h
vga.h microblaze: convert all simple headers to use asm-generic 2009-07-06 10:26:55 +02:00
xor.h