1
0
Fork 0
remarkable-linux/arch/blackfin/kernel
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
..
cplb-mpu blackfin: cplb-mpu: fix page mask table overflow 2012-03-21 11:00:06 +08:00
cplb-nompu bfin cache: dcplb map: add 16M dcplb map for BF60x 2013-05-09 18:22:45 +08:00
.gitignore Blackfin: ignore generated vmlinux.lds 2009-05-27 00:27:03 -04:00
Makefile blackfin: adi gpio driver and pinctrl driver support 2013-11-15 17:33:42 +08:00
asm-offsets.c blackfin: Autogenerate offsets in struct thread_info 2015-04-12 20:58:24 +02:00
bfin_dma.c bfin-dma: only use MDMA3 on bf609 2012-07-24 13:39:48 +08:00
bfin_gpio.c blackfin: gpio: switch to gpiochip_add_data() 2016-02-19 09:51:42 +01:00
bfin_ksyms.c locking/atomic, arch/blackfin: Implement atomic_fetch_{add,sub,and,or,xor}() 2016-06-16 10:48:23 +02:00
cplbinfo.c blackfin updates for Linux 3.10 2013-05-10 07:21:16 -07:00
debug-mmrs.c gpio: Include linux/gpio.h instead of asm/gpio.h 2016-02-16 00:20:03 +01:00
dma-mapping.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dumpstack.c dump_stack: consolidate dump_stack() implementations and unify their behaviors 2013-04-30 17:04:02 -07:00
early_printk.c early_printk: consolidate random copies of identical code 2013-04-29 18:28:13 -07:00
entry.S bfin: switch to generic vfork, get rid of pointless wrappers 2012-11-28 23:43:41 -05:00
exception.c Blackfin: split kernel/traps.c 2010-05-21 09:40:17 -04:00
fixed_code.S Blackfin: mass clean up of copyright/licensing info 2009-10-07 04:36:26 -04:00
flat.c Blackfin: mass clean up of copyright/licensing info 2009-10-07 04:36:26 -04:00
ftrace-entry.S Blackfin: ftrace: Remove check of obsolete variable function_trace_stop 2014-07-18 13:58:10 -04:00
ftrace.c ftrace: Do not pass data to ftrace_dyn_arch_init 2014-03-07 10:06:14 -05:00
gptimers.c blackfin: bf60x: fix compiling warning 2012-05-21 14:54:26 +08:00
ipipe.c Disintegrate asm/system.h for Blackfin [ver #2] 2012-03-21 11:00:08 +08:00
irqchip.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
kgdb.c arch: blackfin: kernel: kgdb: Remove unused function 2015-04-23 22:56:54 +08:00
kgdb_test.c Disintegrate asm/system.h for Blackfin [ver #2] 2012-03-21 11:00:08 +08:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
nmi.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
perf_event.c blackfin/perf: Convert hotplug notifier to state machine 2016-07-14 09:34:36 +02:00
process.c bfin: Fix typo in arch_cpu_idle() 2013-04-10 12:38:48 +02:00
pseudodbg.c Blackfin: show the whole accumulator in the pseudo DBG insn 2010-05-22 14:19:06 -04:00
ptrace.c blackfin/ptrace: call find_vma with the mmap_sem held 2014-06-06 16:08:16 -07:00
reboot.c Blackfin: fix wrong place disabled irq 2012-10-08 14:36:30 +08:00
setup.c arch: blackfin: kernel: setup.c: Cleaning up missing null-terminate in conjunction with strncpy 2015-04-23 21:34:25 +08:00
shadow_console.c blackfin: add bf60x to current framework 2012-05-21 14:54:12 +08:00
signal.c frv: Remove signal translation and exec_domain 2015-04-12 20:58:24 +02:00
stacktrace.c Blackfin: add preliminary support for STACKTRACE 2009-06-13 07:20:14 -04:00
sys_bfin.c blackfin: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:01 -04:00
time-ts.c blackfin/time-ts: Migrate to new 'set-state' interface 2015-08-10 11:40:59 +02:00
time.c time: convert arch_gettimeoffset to a pointer 2012-12-24 09:36:07 -07:00
trace.c vfs: add file_path() helper 2015-06-23 18:00:05 -04:00
traps.c blackfin: Autogenerate offsets in struct thread_info 2015-04-12 20:58:24 +02:00
vmlinux.lds.S arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00