mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d54b1fdb1d
commit
00977a59b9
45 changed files with 91 additions and 91 deletions
|
|
@ -170,37 +170,37 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf,
|
|||
}
|
||||
|
||||
|
||||
static struct file_operations sysconf_fops = {
|
||||
static const struct file_operations sysconf_fops = {
|
||||
.read = sysconf_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
};
|
||||
|
||||
static struct file_operations clock_fops = {
|
||||
static const struct file_operations clock_fops = {
|
||||
.read = clock_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
};
|
||||
|
||||
static struct file_operations display_fops = {
|
||||
static const struct file_operations display_fops = {
|
||||
.read = display_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
};
|
||||
|
||||
static struct file_operations gsctl_fops = {
|
||||
static const struct file_operations gsctl_fops = {
|
||||
.read = gsctl_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
};
|
||||
|
||||
static struct file_operations sdram_fops = {
|
||||
static const struct file_operations sdram_fops = {
|
||||
.read = sdram_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
};
|
||||
|
||||
static struct file_operations misc_fops = {
|
||||
static const struct file_operations misc_fops = {
|
||||
.read = misc_read_file,
|
||||
.write = write_file_dummy,
|
||||
.open = open_file_generic,
|
||||
|
|
|
|||
Loading…
Reference in a new issue