lkml.org 
[lkml]   [2016]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] misc: mic: constify mic_smpt_ops structure
Date
The mic_smpt_ops structure is never modified, so declare is as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
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
\
 
 \ /
  Last update: 2016-08-09 18:41    [W:0.041 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site