linux/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
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 [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
brl_emu.c
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
crash.c ia64: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
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 ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi_stub.S
efi.c ia64: efi: use timespec64 for persistent clock 2016-06-17 13:45:05 -07:00
elfcore.c switch elf_core_write_extra_data() to dump_emit() 2013-11-09 00:16:23 -05:00
entry.h
entry.S [IA64] Enable preadv2 and pwritev2 syscalls for ia64 2016-03-25 14:37:32 -07:00
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_stub.S
esi.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
fsys.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c ia64: ftrace: Fix the comments for ftrace_modify_code() 2015-12-23 14:27:23 -05:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
gate.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_ia64.c ia64: remove deprecated cpus_ usage. 2015-03-10 13:54:38 +10:30
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
irq.c ia64/irq: Use access helper irq_data_get_affinity_mask() 2015-07-27 13:36:37 +02:00
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 Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile ia64: remove paravirt code 2015-06-10 14:26:32 -07:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca_asm.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
mca_drv_asm.S
mca_drv.c Remove cast for kmalloc return value 2013-03-19 16:14:53 -07:00
mca_drv.h
mca.c treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
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_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
perfmon.c exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
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 percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
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 [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
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_decoder.c
unwind_i.h
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
vmlinux.lds.S ia64: remove paravirt code 2015-06-10 14:26:32 -07:00