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/input/input.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/input/input.c')
-rw-r--r-- | drivers/input/input.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 7cf2b4f603a3..14d4c0493c36 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -482,7 +482,7 @@ static int input_proc_devices_open(struct inode *inode, struct file *file) | |||
482 | return seq_open(file, &input_devices_seq_ops); | 482 | return seq_open(file, &input_devices_seq_ops); |
483 | } | 483 | } |
484 | 484 | ||
485 | static struct file_operations input_devices_fileops = { | 485 | static const struct file_operations input_devices_fileops = { |
486 | .owner = THIS_MODULE, | 486 | .owner = THIS_MODULE, |
487 | .open = input_proc_devices_open, | 487 | .open = input_proc_devices_open, |
488 | .poll = input_proc_devices_poll, | 488 | .poll = input_proc_devices_poll, |
@@ -533,7 +533,7 @@ static int input_proc_handlers_open(struct inode *inode, struct file *file) | |||
533 | return seq_open(file, &input_handlers_seq_ops); | 533 | return seq_open(file, &input_handlers_seq_ops); |
534 | } | 534 | } |
535 | 535 | ||
536 | static struct file_operations input_handlers_fileops = { | 536 | static const struct file_operations input_handlers_fileops = { |
537 | .owner = THIS_MODULE, | 537 | .owner = THIS_MODULE, |
538 | .open = input_proc_handlers_open, | 538 | .open = input_proc_handlers_open, |
539 | .read = seq_read, | 539 | .read = seq_read, |
@@ -1142,7 +1142,7 @@ static int input_open_file(struct inode *inode, struct file *file) | |||
1142 | return err; | 1142 | return err; |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | static struct file_operations input_fops = { | 1145 | static const struct file_operations input_fops = { |
1146 | .owner = THIS_MODULE, | 1146 | .owner = THIS_MODULE, |
1147 | .open = input_open_file, | 1147 | .open = input_open_file, |
1148 | }; | 1148 | }; |