mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00: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 <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:
parent
d54b1fdb1d
commit
00977a59b9
45 changed files with 91 additions and 91 deletions
|
@ -25,7 +25,7 @@
|
|||
|
||||
static const char *name_prefix="dlm";
|
||||
static struct miscdevice ctl_device;
|
||||
static struct file_operations device_fops;
|
||||
static const struct file_operations device_fops;
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
|
@ -759,7 +759,7 @@ static int ctl_device_close(struct inode *inode, struct file *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct file_operations device_fops = {
|
||||
static const struct file_operations device_fops = {
|
||||
.open = device_open,
|
||||
.release = device_close,
|
||||
.read = device_read,
|
||||
|
@ -768,7 +768,7 @@ static struct file_operations device_fops = {
|
|||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static struct file_operations ctl_device_fops = {
|
||||
static const struct file_operations ctl_device_fops = {
|
||||
.open = ctl_device_open,
|
||||
.release = ctl_device_close,
|
||||
.write = device_write,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue