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 | 00977a59b951207d38380c75f03a36829950265c (patch) | |
tree | 26933feafebffca95df02c19df03f5e56aada47e /drivers/sbus/char | |
parent | d54b1fdb1d9f82e375a299e22bd366aad52d4c34 (diff) |
[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>
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r-- | drivers/sbus/char/bpp.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/cpwatchdog.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/display7seg.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/envctrl.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/flash.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/jsflash.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/openprom.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/riowatchdog.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/rtc.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/uctrl.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 4 |
11 files changed, 12 insertions, 12 deletions
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c index ac7d1258efee..a39ee80c9715 100644 --- a/drivers/sbus/char/bpp.c +++ b/drivers/sbus/char/bpp.c | |||
@@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd, | |||
846 | return errno; | 846 | return errno; |
847 | } | 847 | } |
848 | 848 | ||
849 | static struct file_operations bpp_fops = { | 849 | static const struct file_operations bpp_fops = { |
850 | .owner = THIS_MODULE, | 850 | .owner = THIS_MODULE, |
851 | .read = bpp_read, | 851 | .read = bpp_read, |
852 | .write = bpp_write, | 852 | .write = bpp_write, |
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c index ad1c7db96cb4..0cfd1e4c032c 100644 --- a/drivers/sbus/char/cpwatchdog.c +++ b/drivers/sbus/char/cpwatchdog.c | |||
@@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id) | |||
459 | return IRQ_HANDLED; | 459 | return IRQ_HANDLED; |
460 | } | 460 | } |
461 | 461 | ||
462 | static struct file_operations wd_fops = { | 462 | static const struct file_operations wd_fops = { |
463 | .owner = THIS_MODULE, | 463 | .owner = THIS_MODULE, |
464 | .ioctl = wd_ioctl, | 464 | .ioctl = wd_ioctl, |
465 | .compat_ioctl = wd_compat_ioctl, | 465 | .compat_ioctl = wd_compat_ioctl, |
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index a4909e0c7f83..2d14a29effe4 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c | |||
@@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
166 | return error; | 166 | return error; |
167 | } | 167 | } |
168 | 168 | ||
169 | static struct file_operations d7s_fops = { | 169 | static const struct file_operations d7s_fops = { |
170 | .owner = THIS_MODULE, | 170 | .owner = THIS_MODULE, |
171 | .unlocked_ioctl = d7s_ioctl, | 171 | .unlocked_ioctl = d7s_ioctl, |
172 | .compat_ioctl = d7s_ioctl, | 172 | .compat_ioctl = d7s_ioctl, |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index fff4660cdf96..2cea4f5d2084 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file) | |||
705 | return 0; | 705 | return 0; |
706 | } | 706 | } |
707 | 707 | ||
708 | static struct file_operations envctrl_fops = { | 708 | static const struct file_operations envctrl_fops = { |
709 | .owner = THIS_MODULE, | 709 | .owner = THIS_MODULE, |
710 | .read = envctrl_read, | 710 | .read = envctrl_read, |
711 | .unlocked_ioctl = envctrl_ioctl, | 711 | .unlocked_ioctl = envctrl_ioctl, |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index fa2418f7ad39..6e99507aeb12 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file) | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | static struct file_operations flash_fops = { | 145 | static const struct file_operations flash_fops = { |
146 | /* no write to the Flash, use mmap | 146 | /* no write to the Flash, use mmap |
147 | * and play flash dependent tricks. | 147 | * and play flash dependent tricks. |
148 | */ | 148 | */ |
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 14631ac11bc7..512857a23169 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c | |||
@@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file) | |||
431 | return 0; | 431 | return 0; |
432 | } | 432 | } |
433 | 433 | ||
434 | static struct file_operations jsf_fops = { | 434 | static const struct file_operations jsf_fops = { |
435 | .owner = THIS_MODULE, | 435 | .owner = THIS_MODULE, |
436 | .llseek = jsf_lseek, | 436 | .llseek = jsf_lseek, |
437 | .read = jsf_read, | 437 | .read = jsf_read, |
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 4e2a0e2dcc2e..e8776230782b 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file) | |||
704 | return 0; | 704 | return 0; |
705 | } | 705 | } |
706 | 706 | ||
707 | static struct file_operations openprom_fops = { | 707 | static const struct file_operations openprom_fops = { |
708 | .owner = THIS_MODULE, | 708 | .owner = THIS_MODULE, |
709 | .llseek = no_llseek, | 709 | .llseek = no_llseek, |
710 | .ioctl = openprom_ioctl, | 710 | .ioctl = openprom_ioctl, |
diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c index 2a9cc8204429..a2fc6b8c1334 100644 --- a/drivers/sbus/char/riowatchdog.c +++ b/drivers/sbus/char/riowatchdog.c | |||
@@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou | |||
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | 195 | ||
196 | static struct file_operations riowd_fops = { | 196 | static const struct file_operations riowd_fops = { |
197 | .owner = THIS_MODULE, | 197 | .owner = THIS_MODULE, |
198 | .ioctl = riowd_ioctl, | 198 | .ioctl = riowd_ioctl, |
199 | .open = riowd_open, | 199 | .open = riowd_open, |
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 9b988baf0b51..94d185829119 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c | |||
@@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
233 | return 0; | 233 | return 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | static struct file_operations rtc_fops = { | 236 | static const struct file_operations rtc_fops = { |
237 | .owner = THIS_MODULE, | 237 | .owner = THIS_MODULE, |
238 | .llseek = no_llseek, | 238 | .llseek = no_llseek, |
239 | .ioctl = rtc_ioctl, | 239 | .ioctl = rtc_ioctl, |
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index b30372f17f1c..4d1a505e9e74 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c | |||
@@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id) | |||
224 | return IRQ_HANDLED; | 224 | return IRQ_HANDLED; |
225 | } | 225 | } |
226 | 226 | ||
227 | static struct file_operations uctrl_fops = { | 227 | static const struct file_operations uctrl_fops = { |
228 | .owner = THIS_MODULE, | 228 | .owner = THIS_MODULE, |
229 | .llseek = no_llseek, | 229 | .llseek = no_llseek, |
230 | .ioctl = uctrl_ioctl, | 230 | .ioctl = uctrl_ioctl, |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 386e7de0b7e3..37a04a0cecfa 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include "vfc.h" | 44 | #include "vfc.h" |
45 | #include <asm/vfc_ioctls.h> | 45 | #include <asm/vfc_ioctls.h> |
46 | 46 | ||
47 | static struct file_operations vfc_fops; | 47 | static const struct file_operations vfc_fops; |
48 | struct vfc_dev **vfc_dev_lst; | 48 | struct vfc_dev **vfc_dev_lst; |
49 | static char vfcstr[]="vfc"; | 49 | static char vfcstr[]="vfc"; |
50 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | 50 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { |
@@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) | |||
633 | } | 633 | } |
634 | 634 | ||
635 | 635 | ||
636 | static struct file_operations vfc_fops = { | 636 | static const struct file_operations vfc_fops = { |
637 | .owner = THIS_MODULE, | 637 | .owner = THIS_MODULE, |
638 | .llseek = no_llseek, | 638 | .llseek = no_llseek, |
639 | .ioctl = vfc_ioctl, | 639 | .ioctl = vfc_ioctl, |