linux/arch/alpha/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
alpha_ksyms.c alpha: Eliminate compiler warning from memset macro 2013-11-16 16:33:09 -08:00
asm-offsets.c
audit.c alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
binfmt_loader.c get rid of pt_regs argument of ->load_binary() 2012-11-28 21:53:38 -05:00
console.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
core_apecs.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_cia.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_irongate.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
core_lca.c
core_marvel.c
core_mcpcia.c
core_polaris.c
core_t2.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
core_titan.c
core_tsunami.c alpha: include module.h to fix modpost on Tsunami 2012-05-02 15:54:06 -04:00
core_wildfire.c
entry.S alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
err_common.c
err_ev6.c alpha: delete non-required instances of <linux/init.h> 2015-05-26 10:01:48 -07:00
err_ev7.c
err_impl.h Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
err_marvel.c
err_titan.c
es1888.c
gct.c
head.S Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
io.c
irq_alpha.c alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
irq_i8259.c
irq_impl.h
irq_pyxis.c
irq_srm.c
irq.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
machvec_impl.h treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
Makefile alpha: Enable system-call auditing support. 2014-01-31 09:21:55 -08:00
module.c module: use a structure to encapsulate layout. 2015-12-04 22:46:25 +01:00
osf_sys.c give readdir(2)/getdents(2)/etc. uniform exclusion with lseek() 2016-05-02 19:49:28 -04:00
pc873xx.c
pc873xx.h
pci_impl.h
pci_iommu.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
pci-noop.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
pci-sysfs.c alpha/PCI: Call iomem_is_exclusive() for IORESOURCE_MEM, but not IORESOURCE_IO 2016-04-25 15:59:50 -05:00
pci.c PCI: Revert "PCI: Call pci_read_bridge_bases() from core instead of arch code" 2015-09-15 13:18:04 -05:00
perf_event.c alpha: Replace __get_cpu_var 2014-08-26 13:45:53 -04:00
process.c exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
proto.h alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
rtc.c alpha, rtc: Change to use rtc_class_ops's set_mmss64() 2015-04-03 08:18:30 +02:00
setup.c alpha: Allow HZ to be configured 2013-11-16 16:33:13 -08:00
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smc37c93x.c
smc37c669.c alpha: remove mysterious if zero-ed out includes 2012-07-30 17:25:11 -07:00
smp.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
srm_env.c srm_env: don't bother with pointer to srm_env_t 2013-04-09 14:13:33 -04:00
srmcons.c alpha: don't use module_init for non-modular core code 2015-05-26 10:01:47 -07:00
sys_alcor.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_cabriolet.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_dp264.c alpha: Don't if-out dp264_device_interrupt. 2013-07-19 13:54:26 -07:00
sys_eb64p.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_eiger.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
sys_jensen.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
sys_marvel.c alpha: clean up unnecessary MSI/MSI-X capability find 2015-05-26 10:01:44 -07:00
sys_miata.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_mikasa.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_nautilus.c PCI: Remove unnecessary #includes of <asm/pci.h> 2015-06-08 07:56:09 -05:00
sys_noritake.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_rawhide.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_ruffian.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_rx164.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_sable.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_sio.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_sx164.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_takara.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
sys_titan.c alpha: irq: remove deprecated use of IRQF_DISABLED 2013-04-07 12:59:30 -07:00
sys_wildfire.c Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00
systbls.S alpha: Wire up all missing implemented syscalls 2015-05-26 10:01:50 -07:00
time.c alpha/time: Migrate to new 'set-state' interface 2015-08-10 11:40:58 +02:00
traps.c alpha: delete non-required instances of <linux/init.h> 2015-05-26 10:01:48 -07:00
vmlinux.lds.S Disintegrate asm/system.h for Alpha 2012-03-28 18:11:12 +01:00