From d54b1fdb1d9f82e375a299e22bd366aad52d4c34 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:34 -0800 Subject: [PATCH] mark struct file_operations const 5 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/rtc/rtc-dev.c | 2 +- drivers/rtc/rtc-proc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 82f2ac87ccd..137330b8636 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c @@ -384,7 +384,7 @@ static int rtc_dev_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &rtc->async_queue); } -static struct file_operations rtc_dev_fops = { +static const struct file_operations rtc_dev_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rtc_dev_read, diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c index c272afd6217..1bd624fc685 100644 --- a/drivers/rtc/rtc-proc.c +++ b/drivers/rtc/rtc-proc.c @@ -96,7 +96,7 @@ static int rtc_proc_release(struct inode *inode, struct file *file) return res; } -static struct file_operations rtc_proc_fops = { +static const struct file_operations rtc_proc_fops = { .open = rtc_proc_open, .read = seq_read, .llseek = seq_lseek, -- cgit v1.2.3-18-g5258