[PATCH] mark struct file_operations const 6

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>
This commit is contained in:
Arjan van de Ven
2007-02-12 00:55:34 -08:00
committed by Linus Torvalds
parent d54b1fdb1d
commit 00977a59b9
45 changed files with 91 additions and 91 deletions

View File

@@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
return errno;
}
static struct file_operations bpp_fops = {
static const struct file_operations bpp_fops = {
.owner = THIS_MODULE,
.read = bpp_read,
.write = bpp_write,

View File

@@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
static struct file_operations wd_fops = {
static const struct file_operations wd_fops = {
.owner = THIS_MODULE,
.ioctl = wd_ioctl,
.compat_ioctl = wd_compat_ioctl,

View File

@@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return error;
}
static struct file_operations d7s_fops = {
static const struct file_operations d7s_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = d7s_ioctl,
.compat_ioctl = d7s_ioctl,

View File

@@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file)
return 0;
}
static struct file_operations envctrl_fops = {
static const struct file_operations envctrl_fops = {
.owner = THIS_MODULE,
.read = envctrl_read,
.unlocked_ioctl = envctrl_ioctl,

View File

@@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file)
return 0;
}
static struct file_operations flash_fops = {
static const struct file_operations flash_fops = {
/* no write to the Flash, use mmap
* and play flash dependent tricks.
*/

View File

@@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file)
return 0;
}
static struct file_operations jsf_fops = {
static const struct file_operations jsf_fops = {
.owner = THIS_MODULE,
.llseek = jsf_lseek,
.read = jsf_read,

View File

@@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file)
return 0;
}
static struct file_operations openprom_fops = {
static const struct file_operations openprom_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = openprom_ioctl,

View File

@@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou
return 0;
}
static struct file_operations riowd_fops = {
static const struct file_operations riowd_fops = {
.owner = THIS_MODULE,
.ioctl = riowd_ioctl,
.open = riowd_open,

View File

@@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file)
return 0;
}
static struct file_operations rtc_fops = {
static const struct file_operations rtc_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = rtc_ioctl,

View File

@@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
static struct file_operations uctrl_fops = {
static const struct file_operations uctrl_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = uctrl_ioctl,

View File

@@ -44,7 +44,7 @@
#include "vfc.h"
#include <asm/vfc_ioctls.h>
static struct file_operations vfc_fops;
static const struct file_operations vfc_fops;
struct vfc_dev **vfc_dev_lst;
static char vfcstr[]="vfc";
static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
@@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
}
static struct file_operations vfc_fops = {
static const struct file_operations vfc_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = vfc_ioctl,