From da7071d7e32d15149cc513f096a3638097b66387 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:36 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- net/irda/ircomm/ircomm_core.c | 2 +- net/irda/iriap.c | 2 +- net/irda/irlan/irlan_common.c | 2 +- net/irda/irlap.c | 2 +- net/irda/irlmp.c | 2 +- net/irda/irttp.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'net/irda') diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index c28ee7bce26..ec40715dcdd 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c @@ -56,7 +56,7 @@ static void ircomm_control_indication(struct ircomm_cb *self, 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 98b0fa96579..915d9384f36 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -1080,7 +1080,7 @@ static int irias_seq_open(struct inode *inode, struct file *file) 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 9c3dc57ff74..fcf9d659962 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c @@ -93,7 +93,7 @@ extern struct proc_dir_entry *proc_irda; 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 fd73e4af715..d93ebd11431 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c @@ -1244,7 +1244,7 @@ out_kfree: 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 b134c3cf2bd..9df0461b6d1 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -2026,7 +2026,7 @@ out_kfree: 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 68836358fdf..a7486b3bddc 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -1895,7 +1895,7 @@ out_kfree: 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, -- cgit v1.2.3-70-g09d2