DORMANTno replies

[PATCH] misc: mic: constify mic_smpt_ops structure

From: Julia Lawall <hidden>
Date: 2016-08-09 15:58:43
Also in: lkml
Subsystem: char and misc drivers, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Linus Torvalds

The mic_smpt_ops structure is never modified, so declare is as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <redacted>

---
 drivers/misc/mic/host/mic_device.h |    2 +-
 drivers/misc/mic/host/mic_x100.c   |    2 +-
 drivers/misc/mic/host/mic_x100.h   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/mic/host/mic_device.h b/drivers/misc/mic/host/mic_device.h
index 52b12b2..2162a8f 100644
--- a/drivers/misc/mic/host/mic_device.h
+++ b/drivers/misc/mic/host/mic_device.h
@@ -82,7 +82,7 @@ struct mic_device {
 	struct pci_dev *pdev;
 	struct mutex mic_mutex;
 	struct mic_hw_intr_ops *intr_ops;
-	struct mic_smpt_ops *smpt_ops;
+	const struct mic_smpt_ops *smpt_ops;
 	struct mic_smpt_info *smpt;
 	struct mic_intr_info *intr_info;
 	struct mic_irq_info irq_info;
diff --git a/drivers/misc/mic/host/mic_x100.c b/drivers/misc/mic/host/mic_x100.c
index 82a973c..ef40b00 100644
--- a/drivers/misc/mic/host/mic_x100.c
+++ b/drivers/misc/mic/host/mic_x100.c
@@ -546,7 +546,7 @@ static void mic_x100_smpt_hw_init(struct mic_device *mdev)
 	info->base = 0x8000000000ULL;
 }
 
-struct mic_smpt_ops mic_x100_smpt_ops = {
+const struct mic_smpt_ops mic_x100_smpt_ops = {
 	.init = mic_x100_smpt_hw_init,
 	.set = mic_x100_smpt_set,
 };
diff --git a/drivers/misc/mic/host/mic_x100.h b/drivers/misc/mic/host/mic_x100.h
index 8b7daa1..457b3a1 100644
--- a/drivers/misc/mic/host/mic_x100.h
+++ b/drivers/misc/mic/host/mic_x100.h
@@ -92,7 +92,7 @@ static const u16 mic_x100_intr_init[] = {
 #define MIC_X100_BSP_INTERRUPT_VECTOR 229
 
 extern struct mic_hw_ops mic_x100_ops;
-extern struct mic_smpt_ops mic_x100_smpt_ops;
+extern const struct mic_smpt_ops mic_x100_smpt_ops;
 extern struct mic_hw_intr_ops mic_x100_intr_ops;
 
 #endif
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help