android_kernel_motorola_sm6225/arch/m68k
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
..
68000 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
amiga genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
apollo m68k/apollo: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
atari m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular 2016-01-10 13:56:40 +01:00
bvme6000 m68k/bvme6000: Include generic <linux/rtc.h> 2016-05-03 16:02:54 +02:00
coldfire m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
configs m68k/defconfig: Update defconfigs for v4.7-rc2 2016-07-19 09:35:54 +02:00
emu block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
fpsp040 Fix common misspellings 2011-03-31 11:26:23 -03:00
hp300 m68k/hp300: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
ifpsp060 m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
include Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 12:41:29 -07:00
kernel dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
lib m68k: Remove FSF address 2015-03-15 10:23:30 +01:00
mac m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
math-emu m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
mm mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
mvme16x m68k/mvme16x: Include generic <linux/rtc.h> 2016-05-03 16:02:59 +02:00
mvme147 m68k/mvme147: config.c - Remove unused functions 2015-01-11 11:38:45 +01:00
q40 m68k: Mark functions only called from setup_arch() __init 2013-11-26 11:08:54 +01:00
sun3 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2016-01-12 10:33:51 -08:00
sun3x m68k: Remove superfluous inclusions of <asm/bootinfo.h> 2013-11-26 11:09:22 +01:00
tools/amiga
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Kconfig.bus m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
Kconfig.cpu Merge branch 'hash' of git://ftp.sciencehorizons.net/linux 2016-05-28 16:15:25 -07:00
Kconfig.debug m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00
Kconfig.devices Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2014-10-08 05:40:17 -04:00
Kconfig.machine m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00
Makefile m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00