[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 <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:

committed by
Linus Torvalds

父節點
fa027c2a0a
當前提交
d54b1fdb1d
@@ -85,7 +85,7 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char __user *buf, size_t
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
static struct file_operations isapnp_proc_bus_file_operations =
|
||||
static const struct file_operations isapnp_proc_bus_file_operations =
|
||||
{
|
||||
.llseek = isapnp_proc_bus_lseek,
|
||||
.read = isapnp_proc_bus_read,
|
||||
|
Reference in New Issue
Block a user