linux-stable/arch/ia64/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
..
.gitignore
Makefile ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
Makefile.gate
acpi-ext.c ACPICA: Resources: Provide common part for struct acpi_resource_address structures. 2015-01-26 16:09:56 +01:00
acpi.c ACPI / NUMA: Move acpi_numa_arch_fixup() to ia64 only 2016-05-30 14:27:07 +02:00
asm-offsets.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
audit.c
brl_emu.c
crash.c ia64: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
crash_dump.c
cyclone.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
dma-mapping.c
efi.c ia64: efi: use timespec64 for persistent clock 2016-06-17 13:45:05 -07:00
efi_stub.S
elfcore.c switch elf_core_write_extra_data() to dump_emit() 2013-11-09 00:16:23 -05:00
entry.S [IA64] Enable preadv2 and pwritev2 syscalls for ia64 2016-03-25 14:37:32 -07:00
entry.h
err_inject.c mm/gup: Switch all callers of get_user_pages() to not pass tsk/mm 2016-02-16 10:11:12 +01:00
esi.c
esi_stub.S
fsys.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
fsyscall_gtod_data.h
ftrace.c ia64: ftrace: Fix the comments for ftrace_modify_code() 2015-12-23 14:27:23 -05:00
gate-data.S
gate.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
gate.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
head.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
ia64_ksyms.c ia64: export flush_icache_range for module use 2015-06-15 14:58:24 -07:00
init_task.c fix up initial thread stack pointer vs thread_info confusion 2016-06-24 17:07:33 -07:00
iosapic.c ia64: rename nop->iosapic_nop 2016-01-12 20:46:47 +02:00
irq.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
irq_ia64.c ia64: remove deprecated cpus_ usage. 2015-03-10 13:54:38 +10:30
irq_lsapic.c
ivt.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
jprobes.S
kprobes.c ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
machine_kexec.c kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t 2016-08-02 19:35:27 -04:00
machvec.c
mca.c treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
mca_asm.S
mca_drv.c Remove cast for kmalloc return value 2013-03-19 16:14:53 -07:00
mca_drv.h
mca_drv_asm.S
minstate.h ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
module.c module: use a structure to encapsulate layout. 2015-12-04 22:46:25 +01:00
msi_ia64.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
nr-irqs.c ia64/xen: Remove Xen support for ia64 2013-12-10 16:11:07 -08:00
numa.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
pal.S
palinfo.c ia64, palinfo: Fix CPU hotplug callback registration 2014-03-20 13:43:40 +01:00
patch.c ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
pci-dma.c [IA64] pci: Remove unused fallback_dev 2013-06-03 16:04:31 -07:00
pci-swiotlb.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
perfmon.c exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
perfmon_default_smpl.c
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
process.c exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
relocate_kernel.S
sal.c
salinfo.c ia64: salinfo: use a waitqueue instead a sema down/up combo 2016-07-25 09:55:32 -07:00
setup.c ACPI / NUMA: Move acpi_numa_arch_fixup() to ia64 only 2016-05-30 14:27:07 +02:00
sigframe.h
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
smpboot.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
stacktrace.c
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c ia64: efi: use timespec64 for persistent clock 2016-06-17 13:45:05 -07:00
topology.c ia64: fix up obsolete cpu function usage. 2015-03-05 15:25:04 +10:30
traps.c ia64/traps: Silence GCC warning about uninitialised variable 2016-05-05 10:29:14 -07:00
unaligned.c ia64/unaligned: Silence another GCC warning about an uninitialised variable 2016-05-05 10:29:14 -07:00
uncached.c mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
unwind.c
unwind_decoder.c
unwind_i.h
vmlinux.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00