alistair23-linux/arch/mips
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
..
alchemy Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
ar7
ath25
ath79 MIPS: ath79: Add missing include file 2016-07-25 07:49:13 -05:00
bcm47xx MIPS: BCM47xx: Move SPROM driver to drivers/firmware/ 2016-05-13 14:01:43 +02:00
bcm63xx
bmips MIPS: BMIPS: Add support for BCM63268 2016-05-13 14:02:09 +02:00
boot MIPS: devicetree: fix cpu interrupt controller node-names 2016-05-28 12:35:12 +02:00
cavium-octeon dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
cobalt
configs mips: use the new LED disk activity trigger 2016-06-27 08:58:41 +02:00
dec MIPS: DEC: Export `ioasic_ssr_lock' to modules 2016-05-17 11:03:54 +02:00
emma
fw
include tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
jazz
jz4740 tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
kernel tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
kvm MIPS: KVM: Reset CP0_PageMask during host TLB flush 2016-08-01 18:42:27 +02:00
lantiq MIPS: Change my email address 2016-05-13 14:02:18 +02:00
lasat MIPS: Lasat: A couple off by one bugs in picvue_proc.c 2016-05-28 12:35:06 +02:00
lib MIPS: lib: Mark intrinsics notrace 2016-05-28 12:35:11 +02:00
loongson32 MIPS: Loongson1B: Some updates/fixes for LS1B 2016-05-13 14:02:05 +02:00
loongson64 dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
math-emu tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
mm dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
mti-malta tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
mti-sead3 mips: Remove unnecessary of_platform_populate with default match table 2016-06-23 15:00:29 -05:00
net tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
netlogic dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
oprofile MIPS/Loongson-3: Convert oprofile to hotplug state machine 2016-07-15 10:40:29 +02:00
paravirt
pci MIPS/PCI: Claim bus resources on PCI_PROBE_ONLY set-ups 2016-06-23 16:32:20 -05:00
pic32 mips: use of_platform_default_populate() to populate default bus 2016-06-23 15:00:42 -05:00
pistachio mips: Remove unnecessary of_platform_populate with default match table 2016-06-23 15:00:29 -05:00
pmcs-msp71xx MIPS: MSP71xx: Use __flush_cache_all instead of flush_cache_all. 2016-05-13 14:01:38 +02:00
pnx833x MIPS: make PCI_DMA_BUS_IS_PHYS=1 constant 2016-05-13 14:02:17 +02:00
power
ralink clocksources: Switch back to the clksrc table 2016-06-28 10:19:35 +02:00
rb532
sgi-ip22
sgi-ip27 MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
sgi-ip32
sibyte MIPS: Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER 2016-05-09 12:00:03 +02:00
sni MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
txx9 treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
vdso MIPS: Build microMIPS VDSO for microMIPS kernels 2016-05-28 12:35:12 +02:00
vr41xx MIPS: VR41xx: Fix typo 2016-05-28 12:35:09 +02:00
xilfpga mips: Remove unnecessary of_platform_populate with default match table 2016-06-23 15:00:29 -05:00
Kbuild
Kbuild.platforms
Kconfig MIPS: Select HAVE_KVM for MIPS64_R{2,6} 2016-08-01 18:42:27 +02:00
Kconfig.debug
Makefile MIPS: Fix VZ probe gas errors with binutils <2.24 2016-05-17 11:06:04 +02:00