diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:45 -0500 |
commit | d54b1fdb1d9f82e375a299e22bd366aad52d4c34 (patch) | |
tree | f94768d59702dbbc0beb9a70d9be65dbc5e5108d /drivers/misc | |
parent | fa027c2a0a0d6d1df6b29ee99048502c93da0dd4 (diff) |
[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>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_cpustate.c | 2 | ||||
-rw-r--r-- | drivers/misc/ibmasm/ibmasmfs.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index 11a801be71c8..ca86f113f36a 100644 --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c | |||
@@ -169,7 +169,7 @@ static struct platform_driver hdpu_cpustate_driver = { | |||
169 | /* | 169 | /* |
170 | * The various file operations we support. | 170 | * The various file operations we support. |
171 | */ | 171 | */ |
172 | static struct file_operations cpustate_fops = { | 172 | static const struct file_operations cpustate_fops = { |
173 | owner:THIS_MODULE, | 173 | owner:THIS_MODULE, |
174 | open:cpustate_open, | 174 | open:cpustate_open, |
175 | release:cpustate_release, | 175 | release:cpustate_release, |
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index b99dc507de2e..c436d3de8b8b 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c | |||
@@ -156,7 +156,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) | |||
156 | static struct dentry *ibmasmfs_create_file (struct super_block *sb, | 156 | static struct dentry *ibmasmfs_create_file (struct super_block *sb, |
157 | struct dentry *parent, | 157 | struct dentry *parent, |
158 | const char *name, | 158 | const char *name, |
159 | struct file_operations *fops, | 159 | const struct file_operations *fops, |
160 | void *data, | 160 | void *data, |
161 | int mode) | 161 | int mode) |
162 | { | 162 | { |
@@ -581,28 +581,28 @@ static ssize_t remote_settings_file_write(struct file *file, const char __user * | |||
581 | return count; | 581 | return count; |
582 | } | 582 | } |
583 | 583 | ||
584 | static struct file_operations command_fops = { | 584 | static const struct file_operations command_fops = { |
585 | .open = command_file_open, | 585 | .open = command_file_open, |
586 | .release = command_file_close, | 586 | .release = command_file_close, |
587 | .read = command_file_read, | 587 | .read = command_file_read, |
588 | .write = command_file_write, | 588 | .write = command_file_write, |
589 | }; | 589 | }; |
590 | 590 | ||
591 | static struct file_operations event_fops = { | 591 | static const struct file_operations event_fops = { |
592 | .open = event_file_open, | 592 | .open = event_file_open, |
593 | .release = event_file_close, | 593 | .release = event_file_close, |
594 | .read = event_file_read, | 594 | .read = event_file_read, |
595 | .write = event_file_write, | 595 | .write = event_file_write, |
596 | }; | 596 | }; |
597 | 597 | ||
598 | static struct file_operations r_heartbeat_fops = { | 598 | static const struct file_operations r_heartbeat_fops = { |
599 | .open = r_heartbeat_file_open, | 599 | .open = r_heartbeat_file_open, |
600 | .release = r_heartbeat_file_close, | 600 | .release = r_heartbeat_file_close, |
601 | .read = r_heartbeat_file_read, | 601 | .read = r_heartbeat_file_read, |
602 | .write = r_heartbeat_file_write, | 602 | .write = r_heartbeat_file_write, |
603 | }; | 603 | }; |
604 | 604 | ||
605 | static struct file_operations remote_settings_fops = { | 605 | static const struct file_operations remote_settings_fops = { |
606 | .open = remote_settings_file_open, | 606 | .open = remote_settings_file_open, |
607 | .release = remote_settings_file_close, | 607 | .release = remote_settings_file_close, |
608 | .read = remote_settings_file_read, | 608 | .read = remote_settings_file_read, |