[PATCH] mark struct file_operations const 4

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.

[akpm@sdl.org: dvb fix]
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:33 -08:00
committed by Linus Torvalds
parent 2b8693c061
commit fa027c2a0a
67 changed files with 78 additions and 78 deletions
+1 -1
View File
@@ -885,7 +885,7 @@ out:
return ret;
}
static struct file_operations adb_fops = {
static const struct file_operations adb_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = adb_read,
+1 -1
View File
@@ -121,7 +121,7 @@ anslcd_open( struct inode * inode, struct file * file )
return 0;
}
struct file_operations anslcd_fops = {
const struct file_operations anslcd_fops = {
.write = anslcd_write,
.ioctl = anslcd_ioctl,
.open = anslcd_open,
+1 -1
View File
@@ -501,7 +501,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
return p - buf;
}
static struct file_operations apm_bios_fops = {
static const struct file_operations apm_bios_fops = {
.owner = THIS_MODULE,
.read = do_read,
.poll = do_poll,
+1 -1
View File
@@ -100,7 +100,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
return 0;
}
struct file_operations nvram_fops = {
const struct file_operations nvram_fops = {
.owner = THIS_MODULE,
.llseek = nvram_llseek,
.read = read_nvram,
+1 -1
View File
@@ -1277,7 +1277,7 @@ static int smu_release(struct inode *inode, struct file *file)
}
static struct file_operations smu_device_fops = {
static const struct file_operations smu_device_fops = {
.llseek = no_llseek,
.read = smu_read,
.write = smu_write,
+1 -1
View File
@@ -2672,7 +2672,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
return error;
}
static struct file_operations pmu_device_fops = {
static const struct file_operations pmu_device_fops = {
.read = pmu_read,
.write = pmu_write,
.poll = pmu_fpoll,
+1 -1
View File
@@ -1040,7 +1040,7 @@ static int pmu_ioctl(struct inode * inode, struct file *filp,
return -EINVAL;
}
static struct file_operations pmu_device_fops = {
static const struct file_operations pmu_device_fops = {
.read = pmu_read,
.write = pmu_write,
.ioctl = pmu_ioctl,
+1 -1
View File
@@ -1473,7 +1473,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
return r;
}
static struct file_operations _ctl_fops = {
static const struct file_operations _ctl_fops = {
.ioctl = ctl_ioctl,
.owner = THIS_MODULE,
};
+1 -1
View File
@@ -4920,7 +4920,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
return mask;
}
static struct file_operations md_seq_fops = {
static const struct file_operations md_seq_fops = {
.owner = THIS_MODULE,
.open = md_seq_open,
.read = seq_read,
+1 -1
View File
@@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
}
}
static struct file_operations video_fops =
static const struct file_operations video_fops =
{
.owner = THIS_MODULE,
.open = fops_open,
+1 -1
View File
@@ -144,7 +144,7 @@ struct dsbr100_device {
/* File system interface */
static struct file_operations usb_dsbr100_fops = {
static const struct file_operations usb_dsbr100_fops = {
.owner = THIS_MODULE,
.open = usb_dsbr100_open,
.release = usb_dsbr100_close,
+1 -1
View File
@@ -216,7 +216,7 @@ static struct pcm20_device pcm20_unit = {
.muted = 1,
};
static struct file_operations pcm20_fops = {
static const struct file_operations pcm20_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -105,7 +105,7 @@ static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length,
}
}
static struct file_operations rds_fops = {
static const struct file_operations rds_fops = {
.owner = THIS_MODULE,
.read = rds_f_read,
.open = rds_f_open,
+1 -1
View File
@@ -358,7 +358,7 @@ static int rt_ioctl(struct inode *inode, struct file *file,
static struct rt_device rtrack_unit;
static struct file_operations rtrack_fops = {
static const struct file_operations rtrack_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -314,7 +314,7 @@ static int az_ioctl(struct inode *inode, struct file *file,
static struct az_device aztech_unit;
static struct file_operations aztech_fops = {
static const struct file_operations aztech_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -507,7 +507,7 @@ cadet_poll(struct file *file, struct poll_table_struct *wait)
}
static struct file_operations cadet_fops = {
static const struct file_operations cadet_fops = {
.owner = THIS_MODULE,
.open = cadet_open,
.release = cadet_release,
+1 -1
View File
@@ -346,7 +346,7 @@ MODULE_DEVICE_TABLE( pci, gemtek_pci_id );
static int mx = 1;
static struct file_operations gemtek_pci_fops = {
static const struct file_operations gemtek_pci_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -296,7 +296,7 @@ static int gemtek_ioctl(struct inode *inode, struct file *file,
static struct gemtek_device gemtek_unit;
static struct file_operations gemtek_fops = {
static const struct file_operations gemtek_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -99,7 +99,7 @@ static struct pci_driver maestro_r_driver = {
.remove = __devexit_p(maestro_remove),
};
static struct file_operations maestro_fops = {
static const struct file_operations maestro_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
+1 -1
View File
@@ -91,7 +91,7 @@ module_param(radio_nr, int, 0);
static int radio_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static struct file_operations maxiradio_fops = {
static const struct file_operations maxiradio_fops = {
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,

Some files were not shown because too many files have changed in this diff Show More