aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/bus
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2017-01-20 16:04:01 -0500
committerDoug Ledford <dledford@redhat.com>2017-01-24 12:23:35 -0500
commit5299709d0a87342dadc1fc9850484fadeb488bf8 (patch)
treea4d866c18765747846a456810ac5f661cecb8fce /drivers/misc/mic/bus
parent102c5ce082f557405a0f71ad5a8920f9df50cd9e (diff)
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>
Diffstat (limited to 'drivers/misc/mic/bus')
-rw-r--r--drivers/misc/mic/bus/mic_bus.c2
-rw-r--r--drivers/misc/mic/bus/scif_bus.c2
-rw-r--r--drivers/misc/mic/bus/scif_bus.h2
-rw-r--r--drivers/misc/mic/bus/vop_bus.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/drivers/misc/mic/bus/mic_bus.c b/drivers/misc/mic/bus/mic_bus.c
index be37890abb93..c4b27a25662a 100644
--- a/drivers/misc/mic/bus/mic_bus.c
+++ b/drivers/misc/mic/bus/mic_bus.c
@@ -143,7 +143,7 @@ static void mbus_release_dev(struct device *d)
143} 143}
144 144
145struct mbus_device * 145struct mbus_device *
146mbus_register_device(struct device *pdev, int id, struct dma_map_ops *dma_ops, 146mbus_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ops,
147 struct mbus_hw_ops *hw_ops, int index, 147 struct mbus_hw_ops *hw_ops, int index,
148 void __iomem *mmio_va) 148 void __iomem *mmio_va)
149{ 149{
diff --git a/drivers/misc/mic/bus/scif_bus.c b/drivers/misc/mic/bus/scif_bus.c
index ff6e01c25810..e5d377e97c86 100644
--- a/drivers/misc/mic/bus/scif_bus.c
+++ b/drivers/misc/mic/bus/scif_bus.c
@@ -138,7 +138,7 @@ static void scif_release_dev(struct device *d)
138} 138}
139 139
140struct scif_hw_dev * 140struct scif_hw_dev *
141scif_register_device(struct device *pdev, int id, struct dma_map_ops *dma_ops, 141scif_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ops,
142 struct scif_hw_ops *hw_ops, u8 dnode, u8 snode, 142 struct scif_hw_ops *hw_ops, u8 dnode, u8 snode,
143 struct mic_mw *mmio, struct mic_mw *aper, void *dp, 143 struct mic_mw *mmio, struct mic_mw *aper, void *dp,
144 void __iomem *rdp, struct dma_chan **chan, int num_chan, 144 void __iomem *rdp, struct dma_chan **chan, int num_chan,
diff --git a/drivers/misc/mic/bus/scif_bus.h b/drivers/misc/mic/bus/scif_bus.h
index 94f29ac608b6..ff59568219ad 100644
--- a/drivers/misc/mic/bus/scif_bus.h
+++ b/drivers/misc/mic/bus/scif_bus.h
@@ -113,7 +113,7 @@ int scif_register_driver(struct scif_driver *driver);
113void scif_unregister_driver(struct scif_driver *driver); 113void scif_unregister_driver(struct scif_driver *driver);
114struct scif_hw_dev * 114struct scif_hw_dev *
115scif_register_device(struct device *pdev, int id, 115scif_register_device(struct device *pdev, int id,
116 struct dma_map_ops *dma_ops, 116 const struct dma_map_ops *dma_ops,
117 struct scif_hw_ops *hw_ops, u8 dnode, u8 snode, 117 struct scif_hw_ops *hw_ops, u8 dnode, u8 snode,
118 struct mic_mw *mmio, struct mic_mw *aper, 118 struct mic_mw *mmio, struct mic_mw *aper,
119 void *dp, void __iomem *rdp, 119 void *dp, void __iomem *rdp,
diff --git a/drivers/misc/mic/bus/vop_bus.c b/drivers/misc/mic/bus/vop_bus.c
index 303da222f5b6..e3caa6c53922 100644
--- a/drivers/misc/mic/bus/vop_bus.c
+++ b/drivers/misc/mic/bus/vop_bus.c
@@ -154,7 +154,7 @@ vop_register_device(struct device *pdev, int id,
154 vdev->dev.parent = pdev; 154 vdev->dev.parent = pdev;
155 vdev->id.device = id; 155 vdev->id.device = id;
156 vdev->id.vendor = VOP_DEV_ANY_ID; 156 vdev->id.vendor = VOP_DEV_ANY_ID;
157 vdev->dev.archdata.dma_ops = (struct dma_map_ops *)dma_ops; 157 vdev->dev.archdata.dma_ops = dma_ops;
158 vdev->dev.dma_mask = &vdev->dev.coherent_dma_mask; 158 vdev->dev.dma_mask = &vdev->dev.coherent_dma_mask;
159 dma_set_mask(&vdev->dev, DMA_BIT_MASK(64)); 159 dma_set_mask(&vdev->dev, DMA_BIT_MASK(64));
160 vdev->dev.release = vop_release_dev; 160 vdev->dev.release = vop_release_dev;