From 2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:32 -0800 Subject: [PATCH] mark struct file_operations const 3 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 --- drivers/isdn/capi/capi.c | 2 +- drivers/isdn/capi/kcapi_proc.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/isdn/capi') diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 9e48bb5a3c0..db1260f73f1 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -1003,7 +1003,7 @@ capi_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations capi_fops = +static const struct file_operations capi_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c index ca9dc00a45c..31f4fd8b8b0 100644 --- a/drivers/isdn/capi/kcapi_proc.c +++ b/drivers/isdn/capi/kcapi_proc.c @@ -113,14 +113,14 @@ static int seq_contrstats_open(struct inode *inode, struct file *file) return seq_open(file, &seq_contrstats_ops); } -static struct file_operations proc_controller_ops = { +static const struct file_operations proc_controller_ops = { .open = seq_controller_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; -static struct file_operations proc_contrstats_ops = { +static const struct file_operations proc_contrstats_ops = { .open = seq_contrstats_open, .read = seq_read, .llseek = seq_lseek, @@ -218,14 +218,14 @@ seq_applstats_open(struct inode *inode, struct file *file) return seq_open(file, &seq_applstats_ops); } -static struct file_operations proc_applications_ops = { +static const struct file_operations proc_applications_ops = { .open = seq_applications_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; -static struct file_operations proc_applstats_ops = { +static const struct file_operations proc_applstats_ops = { .open = seq_applstats_open, .read = seq_read, .llseek = seq_lseek, @@ -302,7 +302,7 @@ seq_capi_driver_open(struct inode *inode, struct file *file) return err; } -static struct file_operations proc_driver_ops = { +static const struct file_operations proc_driver_ops = { .open = seq_capi_driver_open, .read = seq_read, .llseek = seq_lseek, -- cgit v1.2.3