diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:45 -0500 |
commit | 2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 (patch) | |
tree | 3eb7dfbc8d5e4031e4992bdd566e211f5ada71f3 /drivers/block/pktcdvd.c | |
parent | 5dfe4c964a0dd7bb3a1d64a4166835a153146207 (diff) |
[PATCH] mark struct file_operations const 3
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/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index c0e89490e3d5..93fb6ed4ed52 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -435,7 +435,7 @@ static int pkt_debugfs_fops_open(struct inode *inode, struct file *file) | |||
435 | return single_open(file, pkt_debugfs_seq_show, inode->i_private); | 435 | return single_open(file, pkt_debugfs_seq_show, inode->i_private); |
436 | } | 436 | } |
437 | 437 | ||
438 | static struct file_operations debug_fops = { | 438 | static const struct file_operations debug_fops = { |
439 | .open = pkt_debugfs_fops_open, | 439 | .open = pkt_debugfs_fops_open, |
440 | .read = seq_read, | 440 | .read = seq_read, |
441 | .llseek = seq_lseek, | 441 | .llseek = seq_lseek, |
@@ -2725,7 +2725,7 @@ static int pkt_seq_open(struct inode *inode, struct file *file) | |||
2725 | return single_open(file, pkt_seq_show, PDE(inode)->data); | 2725 | return single_open(file, pkt_seq_show, PDE(inode)->data); |
2726 | } | 2726 | } |
2727 | 2727 | ||
2728 | static struct file_operations pkt_proc_fops = { | 2728 | static const struct file_operations pkt_proc_fops = { |
2729 | .open = pkt_seq_open, | 2729 | .open = pkt_seq_open, |
2730 | .read = seq_read, | 2730 | .read = seq_read, |
2731 | .llseek = seq_lseek, | 2731 | .llseek = seq_lseek, |
@@ -3052,7 +3052,7 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm | |||
3052 | } | 3052 | } |
3053 | 3053 | ||
3054 | 3054 | ||
3055 | static struct file_operations pkt_ctl_fops = { | 3055 | static const struct file_operations pkt_ctl_fops = { |
3056 | .ioctl = pkt_ctl_ioctl, | 3056 | .ioctl = pkt_ctl_ioctl, |
3057 | .owner = THIS_MODULE, | 3057 | .owner = THIS_MODULE, |
3058 | }; | 3058 | }; |