[PATCH] mark struct file_operations const 8
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index c28ee7b..ec40715 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -56,7 +56,7 @@
extern struct proc_dir_entry *proc_irda;
static int ircomm_seq_open(struct inode *, struct file *);
-static struct file_operations ircomm_proc_fops = {
+static const struct file_operations ircomm_proc_fops = {
.owner = THIS_MODULE,
.open = ircomm_seq_open,
.read = seq_read,
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 98b0fa9..915d938 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -1080,7 +1080,7 @@
return seq_open(file, &irias_seq_ops);
}
-struct file_operations irias_seq_fops = {
+const struct file_operations irias_seq_fops = {
.owner = THIS_MODULE,
.open = irias_seq_open,
.read = seq_read,
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index 9c3dc57..fcf9d65 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -93,7 +93,7 @@
static int irlan_seq_open(struct inode *inode, struct file *file);
-static struct file_operations irlan_fops = {
+static const struct file_operations irlan_fops = {
.owner = THIS_MODULE,
.open = irlan_seq_open,
.read = seq_read,
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index fd73e4a..d93ebd1 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -1244,7 +1244,7 @@
goto out;
}
-struct file_operations irlap_seq_fops = {
+const struct file_operations irlap_seq_fops = {
.owner = THIS_MODULE,
.open = irlap_seq_open,
.read = seq_read,
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index b134c3c..9df0461 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -2026,7 +2026,7 @@
goto out;
}
-struct file_operations irlmp_seq_fops = {
+const struct file_operations irlmp_seq_fops = {
.owner = THIS_MODULE,
.open = irlmp_seq_open,
.read = seq_read,
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 6883635..a7486b3 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -1895,7 +1895,7 @@
goto out;
}
-struct file_operations irttp_seq_fops = {
+const struct file_operations irttp_seq_fops = {
.owner = THIS_MODULE,
.open = irttp_seq_open,
.read = seq_read,