aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/oprofile_files.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:45 -0500
commitd54b1fdb1d9f82e375a299e22bd366aad52d4c34 (patch)
treef94768d59702dbbc0beb9a70d9be65dbc5e5108d /drivers/oprofile/oprofile_files.c
parentfa027c2a0a0d6d1df6b29ee99048502c93da0dd4 (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/oprofile/oprofile_files.c')
-rw-r--r--drivers/oprofile/oprofile_files.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c
index a72006c08f2..ef953ba5ab6 100644
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -44,7 +44,7 @@ static ssize_t depth_write(struct file * file, char const __user * buf, size_t c
44} 44}
45 45
46 46
47static struct file_operations depth_fops = { 47static const struct file_operations depth_fops = {
48 .read = depth_read, 48 .read = depth_read,
49 .write = depth_write 49 .write = depth_write
50}; 50};
@@ -56,7 +56,7 @@ static ssize_t pointer_size_read(struct file * file, char __user * buf, size_t c
56} 56}
57 57
58 58
59static struct file_operations pointer_size_fops = { 59static const struct file_operations pointer_size_fops = {
60 .read = pointer_size_read, 60 .read = pointer_size_read,
61}; 61};
62 62
@@ -67,7 +67,7 @@ static ssize_t cpu_type_read(struct file * file, char __user * buf, size_t count
67} 67}
68 68
69 69
70static struct file_operations cpu_type_fops = { 70static const struct file_operations cpu_type_fops = {
71 .read = cpu_type_read, 71 .read = cpu_type_read,
72}; 72};
73 73
@@ -101,7 +101,7 @@ static ssize_t enable_write(struct file * file, char const __user * buf, size_t
101} 101}
102 102
103 103
104static struct file_operations enable_fops = { 104static const struct file_operations enable_fops = {
105 .read = enable_read, 105 .read = enable_read,
106 .write = enable_write, 106 .write = enable_write,
107}; 107};
@@ -114,7 +114,7 @@ static ssize_t dump_write(struct file * file, char const __user * buf, size_t co
114} 114}
115 115
116 116
117static struct file_operations dump_fops = { 117static const struct file_operations dump_fops = {
118 .write = dump_write, 118 .write = dump_write,
119}; 119};
120 120