mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[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. [[email protected]: dvb fix] Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2b8693c061
commit
fa027c2a0a
67 changed files with 78 additions and 78 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue