treewide: Constify most dma_map_ops structures
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 20 Jan 2017 21:04:01 +0000 (13:04 -0800)
committerDoug Ledford <dledford@redhat.com>
Tue, 24 Jan 2017 17:23:35 +0000 (12:23 -0500)
commit5299709d0a87342dadc1fc9850484fadeb488bf8
treea4d866c18765747846a456810ac5f661cecb8fce
parent102c5ce082f557405a0f71ad5a8920f9df50cd9e
treewide: Constify most dma_map_ops structures

Most dma_map_ops structures are never modified. Constify these
structures such that these can be write-protected. This patch
has been generated as follows:

git grep -l 'struct dma_map_ops' |
  xargs -d\\n sed -i \
    -e 's/struct dma_map_ops/const struct dma_map_ops/g' \
    -e 's/const struct dma_map_ops {/struct dma_map_ops {/g' \
    -e 's/^const struct dma_map_ops;$/struct dma_map_ops;/' \
    -e 's/const const struct dma_map_ops /const struct dma_map_ops /g';
sed -i -e 's/const \(struct dma_map_ops intel_dma_ops\)/\1/' \
  $(git grep -l 'struct dma_map_ops intel_dma_ops');
sed -i -e 's/const \(struct dma_map_ops dma_iommu_ops\)/\1/' \
  $(git grep -l 'struct dma_map_ops' | grep ^arch/powerpc);
sed -i -e '/^struct vmd_dev {$/,/^};$/ s/const \(struct dma_map_ops[[:blank:]]dma_ops;\)/\1/' \
       -e '/^static void vmd_setup_dma_ops/,/^}$/ s/const \(struct dma_map_ops \*dest\)/\1/' \
       -e 's/const \(struct dma_map_ops \*dest = \&vmd->dma_ops\)/\1/' \
    drivers/pci/host/*.c
sed -i -e '/^void __init pci_iommu_alloc(void)$/,/^}$/ s/dma_ops->/intel_dma_ops./' arch/ia64/kernel/pci-dma.c
sed -i -e 's/static const struct dma_map_ops sn_dma_ops/static struct dma_map_ops sn_dma_ops/' arch/ia64/sn/pci/pci_dma.c
sed -i -e 's/(const struct dma_map_ops \*)//' drivers/misc/mic/bus/vop_bus.c

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Russell King <linux@armlinux.org.uk>
Cc: x86@kernel.org
Signed-off-by: Doug Ledford <dledford@redhat.com>
113 files changed:
arch/alpha/include/asm/dma-mapping.h
arch/alpha/kernel/pci-noop.c
arch/alpha/kernel/pci_iommu.c
arch/arc/include/asm/dma-mapping.h
arch/arc/mm/dma.c
arch/arm/common/dmabounce.c
arch/arm/include/asm/device.h
arch/arm/include/asm/dma-mapping.h
arch/arm/mm/dma-mapping.c
arch/arm/xen/mm.c
arch/arm64/include/asm/device.h
arch/arm64/include/asm/dma-mapping.h
arch/arm64/mm/dma-mapping.c
arch/avr32/include/asm/dma-mapping.h
arch/avr32/mm/dma-coherent.c
arch/blackfin/include/asm/dma-mapping.h
arch/blackfin/kernel/dma-mapping.c
arch/c6x/include/asm/dma-mapping.h
arch/c6x/kernel/dma.c
arch/cris/arch-v32/drivers/pci/dma.c
arch/cris/include/asm/dma-mapping.h
arch/frv/include/asm/dma-mapping.h
arch/frv/mb93090-mb00/pci-dma-nommu.c
arch/frv/mb93090-mb00/pci-dma.c
arch/h8300/include/asm/dma-mapping.h
arch/h8300/kernel/dma.c
arch/hexagon/include/asm/dma-mapping.h
arch/hexagon/kernel/dma.c
arch/ia64/hp/common/hwsw_iommu.c
arch/ia64/hp/common/sba_iommu.c
arch/ia64/include/asm/dma-mapping.h
arch/ia64/include/asm/machvec.h
arch/ia64/kernel/dma-mapping.c
arch/ia64/kernel/pci-dma.c
arch/ia64/kernel/pci-swiotlb.c
arch/m32r/include/asm/device.h
arch/m32r/include/asm/dma-mapping.h
arch/m68k/include/asm/dma-mapping.h
arch/m68k/kernel/dma.c
arch/metag/include/asm/dma-mapping.h
arch/metag/kernel/dma.c
arch/microblaze/include/asm/dma-mapping.h
arch/microblaze/kernel/dma.c
arch/mips/cavium-octeon/dma-octeon.c
arch/mips/include/asm/device.h
arch/mips/include/asm/dma-mapping.h
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
arch/mips/include/asm/netlogic/common.h
arch/mips/loongson64/common/dma-swiotlb.c
arch/mips/mm/dma-default.c
arch/mips/netlogic/common/nlm-dma.c
arch/mn10300/include/asm/dma-mapping.h
arch/mn10300/mm/dma-alloc.c
arch/nios2/include/asm/dma-mapping.h
arch/nios2/mm/dma-mapping.c
arch/openrisc/include/asm/dma-mapping.h
arch/openrisc/kernel/dma.c
arch/parisc/include/asm/dma-mapping.h
arch/parisc/kernel/drivers.c
arch/parisc/kernel/pci-dma.c
arch/powerpc/include/asm/device.h
arch/powerpc/include/asm/dma-mapping.h
arch/powerpc/include/asm/pci.h
arch/powerpc/include/asm/swiotlb.h
arch/powerpc/kernel/dma-swiotlb.c
arch/powerpc/kernel/dma.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/powernv/npu-dma.c
arch/powerpc/platforms/ps3/system-bus.c
arch/powerpc/platforms/pseries/ibmebus.c
arch/powerpc/platforms/pseries/vio.c
arch/s390/include/asm/device.h
arch/s390/include/asm/dma-mapping.h
arch/s390/pci/pci_dma.c
arch/sh/include/asm/dma-mapping.h
arch/sh/kernel/dma-nommu.c
arch/sh/mm/consistent.c
arch/sparc/include/asm/dma-mapping.h
arch/sparc/kernel/iommu.c
arch/sparc/kernel/ioport.c
arch/sparc/kernel/pci_sun4v.c
arch/tile/include/asm/device.h
arch/tile/include/asm/dma-mapping.h
arch/tile/kernel/pci-dma.c
arch/unicore32/include/asm/dma-mapping.h
arch/unicore32/mm/dma-swiotlb.c
arch/x86/include/asm/device.h
arch/x86/include/asm/dma-mapping.h
arch/x86/include/asm/iommu.h
arch/x86/kernel/amd_gart_64.c
arch/x86/kernel/pci-calgary_64.c
arch/x86/kernel/pci-dma.c
arch/x86/kernel/pci-nommu.c
arch/x86/kernel/pci-swiotlb.c
arch/x86/pci/sta2x11-fixup.c
arch/x86/xen/pci-swiotlb-xen.c
arch/xtensa/include/asm/device.h
arch/xtensa/include/asm/dma-mapping.h
arch/xtensa/kernel/pci-dma.c
drivers/iommu/amd_iommu.c
drivers/misc/mic/bus/mic_bus.c
drivers/misc/mic/bus/scif_bus.c
drivers/misc/mic/bus/scif_bus.h
drivers/misc/mic/bus/vop_bus.c
drivers/misc/mic/host/mic_boot.c
drivers/parisc/ccio-dma.c
drivers/parisc/sba_iommu.c
drivers/pci/host/vmd.c
include/linux/dma-mapping.h
include/linux/mic_bus.h
include/xen/arm/hypervisor.h
lib/dma-noop.c