aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:37 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commit9c2e08c592cd357a8330c34def1e8ecfdcf53275 (patch)
tree62e7449e43bb502f2e9630ab41832ceccd9a0f65
parentda7071d7e32d15149cc513f096a3638097b66387 (diff)
[PATCH] mark struct file_operations const 9
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>
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h2
-rw-r--r--drivers/s390/char/tape_class.c2
-rw-r--r--drivers/s390/char/tape_class.h2
-rw-r--r--security/inode.c4
-rw-r--r--security/keys/proc.c4
-rw-r--r--security/selinux/selinuxfs.c26
-rw-r--r--sound/core/control.c2
-rw-r--r--sound/core/hwdep.c2
-rw-r--r--sound/core/info.c2
-rw-r--r--sound/core/init.c4
-rw-r--r--sound/core/oss/mixer_oss.c2
-rw-r--r--sound/core/oss/pcm_oss.c2
-rw-r--r--sound/core/pcm_native.c2
-rw-r--r--sound/core/rawmidi.c2
-rw-r--r--sound/core/seq/oss/seq_oss.c2
-rw-r--r--sound/core/seq/seq_clientmgr.c2
-rw-r--r--sound/core/sound.c2
-rw-r--r--sound/core/timer.c2
-rw-r--r--sound/oss/ad1889.c4
-rw-r--r--sound/oss/btaudio.c6
-rw-r--r--sound/oss/dmasound/dmasound_core.c6
-rw-r--r--sound/oss/emu10k1/audio.c2
-rw-r--r--sound/oss/emu10k1/midi.c2
-rw-r--r--sound/oss/emu10k1/mixer.c2
-rw-r--r--sound/oss/hal2.c4
-rw-r--r--sound/oss/msnd_pinnacle.c2
-rw-r--r--sound/oss/os.h2
-rw-r--r--sound/oss/sh_dac_audio.c2
-rw-r--r--sound/oss/soundcard.c2
-rw-r--r--sound/oss/via82cxxx_audio.c4
-rw-r--r--sound/oss/vwsnd.c4
-rw-r--r--sound/sound_core.c2
32 files changed, 55 insertions, 55 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 70fb13395c04..56864469215e 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -149,7 +149,7 @@ long spufs_run_spu(struct file *file,
149 struct spu_context *ctx, u32 *npc, u32 *status); 149 struct spu_context *ctx, u32 *npc, u32 *status);
150long spufs_create(struct nameidata *nd, 150long spufs_create(struct nameidata *nd,
151 unsigned int flags, mode_t mode); 151 unsigned int flags, mode_t mode);
152extern struct file_operations spufs_context_fops; 152extern const struct file_operations spufs_context_fops;
153 153
154/* gang management */ 154/* gang management */
155struct spu_gang *alloc_spu_gang(void); 155struct spu_gang *alloc_spu_gang(void);
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index 56b87618b100..2e0d29730b67 100644
--- a/drivers/s390/char/tape_class.c
+++ b/drivers/s390/char/tape_class.c
@@ -36,7 +36,7 @@ static struct class *tape_class;
36struct tape_class_device *register_tape_dev( 36struct tape_class_device *register_tape_dev(
37 struct device * device, 37 struct device * device,
38 dev_t dev, 38 dev_t dev,
39 struct file_operations *fops, 39 const struct file_operations *fops,
40 char * device_name, 40 char * device_name,
41 char * mode_name) 41 char * mode_name)
42{ 42{
diff --git a/drivers/s390/char/tape_class.h b/drivers/s390/char/tape_class.h
index 3d0ca054cdee..a8bd9b47fad6 100644
--- a/drivers/s390/char/tape_class.h
+++ b/drivers/s390/char/tape_class.h
@@ -52,7 +52,7 @@ struct tape_class_device {
52struct tape_class_device *register_tape_dev( 52struct tape_class_device *register_tape_dev(
53 struct device * device, 53 struct device * device,
54 dev_t dev, 54 dev_t dev,
55 struct file_operations *fops, 55 const struct file_operations *fops,
56 char * device_name, 56 char * device_name,
57 char * node_name 57 char * node_name
58); 58);
diff --git a/security/inode.c b/security/inode.c
index 9b16e14f3a80..d7ecf89fbc74 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -50,7 +50,7 @@ static int default_open(struct inode *inode, struct file *file)
50 return 0; 50 return 0;
51} 51}
52 52
53static struct file_operations default_file_ops = { 53static const struct file_operations default_file_ops = {
54 .read = default_read_file, 54 .read = default_read_file,
55 .write = default_write_file, 55 .write = default_write_file,
56 .open = default_open, 56 .open = default_open,
@@ -215,7 +215,7 @@ static int create_by_name(const char *name, mode_t mode,
215 */ 215 */
216struct dentry *securityfs_create_file(const char *name, mode_t mode, 216struct dentry *securityfs_create_file(const char *name, mode_t mode,
217 struct dentry *parent, void *data, 217 struct dentry *parent, void *data,
218 struct file_operations *fops) 218 const struct file_operations *fops)
219{ 219{
220 struct dentry *dentry = NULL; 220 struct dentry *dentry = NULL;
221 int error; 221 int error;
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 686a9ee0c5de..3e0d0a6e224f 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -33,7 +33,7 @@ static struct seq_operations proc_keys_ops = {
33 .show = proc_keys_show, 33 .show = proc_keys_show,
34}; 34};
35 35
36static struct file_operations proc_keys_fops = { 36static const struct file_operations proc_keys_fops = {
37 .open = proc_keys_open, 37 .open = proc_keys_open,
38 .read = seq_read, 38 .read = seq_read,
39 .llseek = seq_lseek, 39 .llseek = seq_lseek,
@@ -54,7 +54,7 @@ static struct seq_operations proc_key_users_ops = {
54 .show = proc_key_users_show, 54 .show = proc_key_users_show,
55}; 55};
56 56
57static struct file_operations proc_key_users_fops = { 57static const struct file_operations proc_key_users_fops = {
58 .open = proc_key_users_open, 58 .open = proc_key_users_open,
59 .read = seq_read, 59 .read = seq_read,
60 .llseek = seq_lseek, 60 .llseek = seq_lseek,
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index c8bf6e172f6e..93b3177c7585 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -161,7 +161,7 @@ out:
161#define sel_write_enforce NULL 161#define sel_write_enforce NULL
162#endif 162#endif
163 163
164static struct file_operations sel_enforce_ops = { 164static const struct file_operations sel_enforce_ops = {
165 .read = sel_read_enforce, 165 .read = sel_read_enforce,
166 .write = sel_write_enforce, 166 .write = sel_write_enforce,
167}; 167};
@@ -211,7 +211,7 @@ out:
211#define sel_write_disable NULL 211#define sel_write_disable NULL
212#endif 212#endif
213 213
214static struct file_operations sel_disable_ops = { 214static const struct file_operations sel_disable_ops = {
215 .write = sel_write_disable, 215 .write = sel_write_disable,
216}; 216};
217 217
@@ -225,7 +225,7 @@ static ssize_t sel_read_policyvers(struct file *filp, char __user *buf,
225 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); 225 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
226} 226}
227 227
228static struct file_operations sel_policyvers_ops = { 228static const struct file_operations sel_policyvers_ops = {
229 .read = sel_read_policyvers, 229 .read = sel_read_policyvers,
230}; 230};
231 231
@@ -242,7 +242,7 @@ static ssize_t sel_read_mls(struct file *filp, char __user *buf,
242 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); 242 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
243} 243}
244 244
245static struct file_operations sel_mls_ops = { 245static const struct file_operations sel_mls_ops = {
246 .read = sel_read_mls, 246 .read = sel_read_mls,
247}; 247};
248 248
@@ -294,7 +294,7 @@ out:
294 return length; 294 return length;
295} 295}
296 296
297static struct file_operations sel_load_ops = { 297static const struct file_operations sel_load_ops = {
298 .write = sel_write_load, 298 .write = sel_write_load,
299}; 299};
300 300
@@ -374,7 +374,7 @@ out:
374 free_page((unsigned long) page); 374 free_page((unsigned long) page);
375 return length; 375 return length;
376} 376}
377static struct file_operations sel_checkreqprot_ops = { 377static const struct file_operations sel_checkreqprot_ops = {
378 .read = sel_read_checkreqprot, 378 .read = sel_read_checkreqprot,
379 .write = sel_write_checkreqprot, 379 .write = sel_write_checkreqprot,
380}; 380};
@@ -423,7 +423,7 @@ out:
423 free_page((unsigned long) page); 423 free_page((unsigned long) page);
424 return length; 424 return length;
425} 425}
426static struct file_operations sel_compat_net_ops = { 426static const struct file_operations sel_compat_net_ops = {
427 .read = sel_read_compat_net, 427 .read = sel_read_compat_net,
428 .write = sel_write_compat_net, 428 .write = sel_write_compat_net,
429}; 429};
@@ -467,7 +467,7 @@ static ssize_t selinux_transaction_write(struct file *file, const char __user *b
467 return rv; 467 return rv;
468} 468}
469 469
470static struct file_operations transaction_ops = { 470static const struct file_operations transaction_ops = {
471 .write = selinux_transaction_write, 471 .write = selinux_transaction_write,
472 .read = simple_transaction_read, 472 .read = simple_transaction_read,
473 .release = simple_transaction_release, 473 .release = simple_transaction_release,
@@ -875,7 +875,7 @@ out:
875 return length; 875 return length;
876} 876}
877 877
878static struct file_operations sel_bool_ops = { 878static const struct file_operations sel_bool_ops = {
879 .read = sel_read_bool, 879 .read = sel_read_bool,
880 .write = sel_write_bool, 880 .write = sel_write_bool,
881}; 881};
@@ -932,7 +932,7 @@ out:
932 return length; 932 return length;
933} 933}
934 934
935static struct file_operations sel_commit_bools_ops = { 935static const struct file_operations sel_commit_bools_ops = {
936 .write = sel_commit_bools_write, 936 .write = sel_commit_bools_write,
937}; 937};
938 938
@@ -1131,12 +1131,12 @@ out:
1131 return ret; 1131 return ret;
1132} 1132}
1133 1133
1134static struct file_operations sel_avc_cache_threshold_ops = { 1134static const struct file_operations sel_avc_cache_threshold_ops = {
1135 .read = sel_read_avc_cache_threshold, 1135 .read = sel_read_avc_cache_threshold,
1136 .write = sel_write_avc_cache_threshold, 1136 .write = sel_write_avc_cache_threshold,
1137}; 1137};
1138 1138
1139static struct file_operations sel_avc_hash_stats_ops = { 1139static const struct file_operations sel_avc_hash_stats_ops = {
1140 .read = sel_read_avc_hash_stats, 1140 .read = sel_read_avc_hash_stats,
1141}; 1141};
1142 1142
@@ -1198,7 +1198,7 @@ static int sel_open_avc_cache_stats(struct inode *inode, struct file *file)
1198 return seq_open(file, &sel_avc_cache_stats_seq_ops); 1198 return seq_open(file, &sel_avc_cache_stats_seq_ops);
1199} 1199}
1200 1200
1201static struct file_operations sel_avc_cache_stats_ops = { 1201static const struct file_operations sel_avc_cache_stats_ops = {
1202 .open = sel_open_avc_cache_stats, 1202 .open = sel_open_avc_cache_stats,
1203 .read = seq_read, 1203 .read = seq_read,
1204 .llseek = seq_lseek, 1204 .llseek = seq_lseek,
diff --git a/sound/core/control.c b/sound/core/control.c
index 42bcf2794b28..86de7258b76d 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1398,7 +1398,7 @@ static int snd_ctl_fasync(int fd, struct file * file, int on)
1398 * INIT PART 1398 * INIT PART
1399 */ 1399 */
1400 1400
1401static struct file_operations snd_ctl_f_ops = 1401static const struct file_operations snd_ctl_f_ops =
1402{ 1402{
1403 .owner = THIS_MODULE, 1403 .owner = THIS_MODULE,
1404 .read = snd_ctl_read, 1404 .read = snd_ctl_read,
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 39c03f3dfbfa..96ffdf18c3fe 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -317,7 +317,7 @@ static int snd_hwdep_control_ioctl(struct snd_card *card,
317 317
318 */ 318 */
319 319
320static struct file_operations snd_hwdep_f_ops = 320static const struct file_operations snd_hwdep_f_ops =
321{ 321{
322 .owner = THIS_MODULE, 322 .owner = THIS_MODULE,
323 .llseek = snd_hwdep_llseek, 323 .llseek = snd_hwdep_llseek,
diff --git a/sound/core/info.c b/sound/core/info.c
index 54591e2eb6ee..bf6dbf99528b 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -507,7 +507,7 @@ static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
507 return -ENXIO; 507 return -ENXIO;
508} 508}
509 509
510static struct file_operations snd_info_entry_operations = 510static const struct file_operations snd_info_entry_operations =
511{ 511{
512 .owner = THIS_MODULE, 512 .owner = THIS_MODULE,
513 .llseek = snd_info_entry_llseek, 513 .llseek = snd_info_entry_llseek,
diff --git a/sound/core/init.c b/sound/core/init.c
index db6103733742..4a431e3ea3a2 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -36,7 +36,7 @@
36static DEFINE_SPINLOCK(shutdown_lock); 36static DEFINE_SPINLOCK(shutdown_lock);
37static LIST_HEAD(shutdown_files); 37static LIST_HEAD(shutdown_files);
38 38
39static struct file_operations snd_shutdown_f_ops; 39static const struct file_operations snd_shutdown_f_ops;
40 40
41static unsigned int snd_cards_lock; /* locked for registering/using */ 41static unsigned int snd_cards_lock; /* locked for registering/using */
42struct snd_card *snd_cards[SNDRV_CARDS]; 42struct snd_card *snd_cards[SNDRV_CARDS];
@@ -244,7 +244,7 @@ static int snd_disconnect_fasync(int fd, struct file *file, int on)
244 return -ENODEV; 244 return -ENODEV;
245} 245}
246 246
247static struct file_operations snd_shutdown_f_ops = 247static const struct file_operations snd_shutdown_f_ops =
248{ 248{
249 .owner = THIS_MODULE, 249 .owner = THIS_MODULE,
250 .llseek = snd_disconnect_llseek, 250 .llseek = snd_disconnect_llseek,
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 3391f2a9b4d1..74a2923eb401 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -390,7 +390,7 @@ int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned l
390 * REGISTRATION PART 390 * REGISTRATION PART
391 */ 391 */
392 392
393static struct file_operations snd_mixer_oss_f_ops = 393static const struct file_operations snd_mixer_oss_f_ops =
394{ 394{
395 .owner = THIS_MODULE, 395 .owner = THIS_MODULE,
396 .open = snd_mixer_oss_open, 396 .open = snd_mixer_oss_open,
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 786a82e68890..c4744bb07f41 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2889,7 +2889,7 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
2889 * ENTRY functions 2889 * ENTRY functions
2890 */ 2890 */
2891 2891
2892static struct file_operations snd_pcm_oss_f_reg = 2892static const struct file_operations snd_pcm_oss_f_reg =
2893{ 2893{
2894 .owner = THIS_MODULE, 2894 .owner = THIS_MODULE,
2895 .read = snd_pcm_oss_read, 2895 .read = snd_pcm_oss_read,
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index b52e89393fa3..3e276fcf3336 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3424,7 +3424,7 @@ out:
3424 * Register section 3424 * Register section
3425 */ 3425 */
3426 3426
3427struct file_operations snd_pcm_f_ops[2] = { 3427const struct file_operations snd_pcm_f_ops[2] = {
3428 { 3428 {
3429 .owner = THIS_MODULE, 3429 .owner = THIS_MODULE,
3430 .write = snd_pcm_write, 3430 .write = snd_pcm_write,
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 7e6ceec738d5..d14dcbb6dbca 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1359,7 +1359,7 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
1359 * Register functions 1359 * Register functions
1360 */ 1360 */
1361 1361
1362static struct file_operations snd_rawmidi_f_ops = 1362static const struct file_operations snd_rawmidi_f_ops =
1363{ 1363{
1364 .owner = THIS_MODULE, 1364 .owner = THIS_MODULE,
1365 .read = snd_rawmidi_read, 1365 .read = snd_rawmidi_read,
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index 92858cf8b6eb..2eb987308b53 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -208,7 +208,7 @@ odev_poll(struct file *file, poll_table * wait)
208 * registration of sequencer minor device 208 * registration of sequencer minor device
209 */ 209 */
210 210
211static struct file_operations seq_oss_f_ops = 211static const struct file_operations seq_oss_f_ops =
212{ 212{
213 .owner = THIS_MODULE, 213 .owner = THIS_MODULE,
214 .read = odev_read, 214 .read = odev_read,
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index bb9dd9fa8e51..694efe832b67 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2538,7 +2538,7 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
2538 * REGISTRATION PART 2538 * REGISTRATION PART
2539 */ 2539 */
2540 2540
2541static struct file_operations snd_seq_f_ops = 2541static const struct file_operations snd_seq_f_ops =
2542{ 2542{
2543 .owner = THIS_MODULE, 2543 .owner = THIS_MODULE,
2544 .read = snd_seq_read, 2544 .read = snd_seq_read,
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 4084de064127..70600df94d62 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -168,7 +168,7 @@ static int snd_open(struct inode *inode, struct file *file)
168 return err; 168 return err;
169} 169}
170 170
171static struct file_operations snd_fops = 171static const struct file_operations snd_fops =
172{ 172{
173 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
174 .open = snd_open 174 .open = snd_open
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 3e0638351069..160e40ede723 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1901,7 +1901,7 @@ static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait)
1901#define snd_timer_user_ioctl_compat NULL 1901#define snd_timer_user_ioctl_compat NULL
1902#endif 1902#endif
1903 1903
1904static struct file_operations snd_timer_f_ops = 1904static const struct file_operations snd_timer_f_ops =
1905{ 1905{
1906 .owner = THIS_MODULE, 1906 .owner = THIS_MODULE,
1907 .read = snd_timer_user_read, 1907 .read = snd_timer_user_read,
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 09263d72a519..f0724327493c 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -778,7 +778,7 @@ static int ad1889_release(struct inode *inode, struct file *file)
778 return 0; 778 return 0;
779} 779}
780 780
781static struct file_operations ad1889_fops = { 781static const struct file_operations ad1889_fops = {
782 .owner = THIS_MODULE, 782 .owner = THIS_MODULE,
783 .llseek = no_llseek, 783 .llseek = no_llseek,
784 .read = ad1889_read, 784 .read = ad1889_read,
@@ -812,7 +812,7 @@ static int ad1889_mixer_ioctl(struct inode *inode, struct file *file,
812 return codec->mixer_ioctl(codec, cmd, arg); 812 return codec->mixer_ioctl(codec, cmd, arg);
813} 813}
814 814
815static struct file_operations ad1889_mixer_fops = { 815static const struct file_operations ad1889_mixer_fops = {
816 .owner = THIS_MODULE, 816 .owner = THIS_MODULE,
817 .llseek = no_llseek, 817 .llseek = no_llseek,
818 .ioctl = ad1889_mixer_ioctl, 818 .ioctl = ad1889_mixer_ioctl,
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index ad7210a00dc0..f845528e1fac 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -429,7 +429,7 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
429 return 0; 429 return 0;
430} 430}
431 431
432static struct file_operations btaudio_mixer_fops = { 432static const struct file_operations btaudio_mixer_fops = {
433 .owner = THIS_MODULE, 433 .owner = THIS_MODULE,
434 .llseek = no_llseek, 434 .llseek = no_llseek,
435 .open = btaudio_mixer_open, 435 .open = btaudio_mixer_open,
@@ -796,7 +796,7 @@ static unsigned int btaudio_dsp_poll(struct file *file, struct poll_table_struct
796 return mask; 796 return mask;
797} 797}
798 798
799static struct file_operations btaudio_digital_dsp_fops = { 799static const struct file_operations btaudio_digital_dsp_fops = {
800 .owner = THIS_MODULE, 800 .owner = THIS_MODULE,
801 .llseek = no_llseek, 801 .llseek = no_llseek,
802 .open = btaudio_dsp_open_digital, 802 .open = btaudio_dsp_open_digital,
@@ -807,7 +807,7 @@ static struct file_operations btaudio_digital_dsp_fops = {
807 .poll = btaudio_dsp_poll, 807 .poll = btaudio_dsp_poll,
808}; 808};
809 809
810static struct file_operations btaudio_analog_dsp_fops = { 810static const struct file_operations btaudio_analog_dsp_fops = {
811 .owner = THIS_MODULE, 811 .owner = THIS_MODULE,
812 .llseek = no_llseek, 812 .llseek = no_llseek,
813 .open = btaudio_dsp_open_analog, 813 .open = btaudio_dsp_open_analog,
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 80b836e80d99..a0ec886f2aa3 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -371,7 +371,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
371 return -EINVAL; 371 return -EINVAL;
372} 372}
373 373
374static struct file_operations mixer_fops = 374static const struct file_operations mixer_fops =
375{ 375{
376 .owner = THIS_MODULE, 376 .owner = THIS_MODULE,
377 .llseek = no_llseek, 377 .llseek = no_llseek,
@@ -1337,7 +1337,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
1337 return -EINVAL; 1337 return -EINVAL;
1338} 1338}
1339 1339
1340static struct file_operations sq_fops = 1340static const struct file_operations sq_fops =
1341{ 1341{
1342 .owner = THIS_MODULE, 1342 .owner = THIS_MODULE,
1343 .llseek = no_llseek, 1343 .llseek = no_llseek,
@@ -1561,7 +1561,7 @@ static ssize_t state_read(struct file *file, char __user *buf, size_t count,
1561 return n; 1561 return n;
1562} 1562}
1563 1563
1564static struct file_operations state_fops = { 1564static const struct file_operations state_fops = {
1565 .owner = THIS_MODULE, 1565 .owner = THIS_MODULE,
1566 .llseek = no_llseek, 1566 .llseek = no_llseek,
1567 .read = state_read, 1567 .read = state_read,
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
index efcf589d7083..e75ea21eb811 100644
--- a/sound/oss/emu10k1/audio.c
+++ b/sound/oss/emu10k1/audio.c
@@ -1582,7 +1582,7 @@ static void emu10k1_waveout_bh(unsigned long refdata)
1582 return; 1582 return;
1583} 1583}
1584 1584
1585struct file_operations emu10k1_audio_fops = { 1585const struct file_operations emu10k1_audio_fops = {
1586 .owner = THIS_MODULE, 1586 .owner = THIS_MODULE,
1587 .llseek = no_llseek, 1587 .llseek = no_llseek,
1588 .read = emu10k1_audio_read, 1588 .read = emu10k1_audio_read,
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index cca3dad2bdf4..df1e990449a0 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -458,7 +458,7 @@ int emu10k1_midi_callback(unsigned long msg, unsigned long refdata, unsigned lon
458} 458}
459 459
460/* MIDI file operations */ 460/* MIDI file operations */
461struct file_operations emu10k1_midi_fops = { 461const struct file_operations emu10k1_midi_fops = {
462 .owner = THIS_MODULE, 462 .owner = THIS_MODULE,
463 .read = emu10k1_midi_read, 463 .read = emu10k1_midi_read,
464 .write = emu10k1_midi_write, 464 .write = emu10k1_midi_write,
diff --git a/sound/oss/emu10k1/mixer.c b/sound/oss/emu10k1/mixer.c
index 6419796c2ed7..bc3805fb0701 100644
--- a/sound/oss/emu10k1/mixer.c
+++ b/sound/oss/emu10k1/mixer.c
@@ -681,7 +681,7 @@ static int emu10k1_mixer_release(struct inode *inode, struct file *file)
681 return 0; 681 return 0;
682} 682}
683 683
684struct file_operations emu10k1_mixer_fops = { 684const struct file_operations emu10k1_mixer_fops = {
685 .owner = THIS_MODULE, 685 .owner = THIS_MODULE,
686 .llseek = no_llseek, 686 .llseek = no_llseek,
687 .ioctl = emu10k1_mixer_ioctl, 687 .ioctl = emu10k1_mixer_ioctl,
diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c
index d18286ccc14d..80a42773c648 100644
--- a/sound/oss/hal2.c
+++ b/sound/oss/hal2.c
@@ -1377,7 +1377,7 @@ static int hal2_release(struct inode *inode, struct file *file)
1377 return 0; 1377 return 0;
1378} 1378}
1379 1379
1380static struct file_operations hal2_audio_fops = { 1380static const struct file_operations hal2_audio_fops = {
1381 .owner = THIS_MODULE, 1381 .owner = THIS_MODULE,
1382 .llseek = no_llseek, 1382 .llseek = no_llseek,
1383 .read = hal2_read, 1383 .read = hal2_read,
@@ -1388,7 +1388,7 @@ static struct file_operations hal2_audio_fops = {
1388 .release = hal2_release, 1388 .release = hal2_release,
1389}; 1389};
1390 1390
1391static struct file_operations hal2_mixer_fops = { 1391static const struct file_operations hal2_mixer_fops = {
1392 .owner = THIS_MODULE, 1392 .owner = THIS_MODULE,
1393 .llseek = no_llseek, 1393 .llseek = no_llseek,
1394 .ioctl = hal2_ioctl_mixdev, 1394 .ioctl = hal2_ioctl_mixdev,
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index 24110d63b136..f1f49ebf752e 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -1106,7 +1106,7 @@ static irqreturn_t intr(int irq, void *dev_id)
1106 return IRQ_HANDLED; 1106 return IRQ_HANDLED;
1107} 1107}
1108 1108
1109static struct file_operations dev_fileops = { 1109static const struct file_operations dev_fileops = {
1110 .owner = THIS_MODULE, 1110 .owner = THIS_MODULE,
1111 .read = dev_read, 1111 .read = dev_read,
1112 .write = dev_write, 1112 .write = dev_write,
diff --git a/sound/oss/os.h b/sound/oss/os.h
index 0490562c7f7f..a1a962d7f67d 100644
--- a/sound/oss/os.h
+++ b/sound/oss/os.h
@@ -43,4 +43,4 @@ extern int sound_nblocks;
43#undef PSEUDO_DMA_AUTOINIT 43#undef PSEUDO_DMA_AUTOINIT
44#define ALLOW_BUFFER_MAPPING 44#define ALLOW_BUFFER_MAPPING
45 45
46extern struct file_operations oss_sound_fops; 46extern const struct file_operations oss_sound_fops;
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c
index 51f554154c48..7ea9accc2ba4 100644
--- a/sound/oss/sh_dac_audio.c
+++ b/sound/oss/sh_dac_audio.c
@@ -255,7 +255,7 @@ static int dac_audio_release(struct inode *inode, struct file *file)
255 return 0; 255 return 0;
256} 256}
257 257
258struct file_operations dac_audio_fops = { 258const struct file_operations dac_audio_fops = {
259 .read = dac_audio_read, 259 .read = dac_audio_read,
260 .write = dac_audio_write, 260 .write = dac_audio_write,
261 .ioctl = dac_audio_ioctl, 261 .ioctl = dac_audio_ioctl,
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index b92c8cd1aeaf..dcd8d6d2f56f 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -483,7 +483,7 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
483 return 0; 483 return 0;
484} 484}
485 485
486struct file_operations oss_sound_fops = { 486const struct file_operations oss_sound_fops = {
487 .owner = THIS_MODULE, 487 .owner = THIS_MODULE,
488 .llseek = no_llseek, 488 .llseek = no_llseek,
489 .read = sound_read, 489 .read = sound_read,
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
index c96cc8c68b3b..7ab3a732e184 100644
--- a/sound/oss/via82cxxx_audio.c
+++ b/sound/oss/via82cxxx_audio.c
@@ -1619,7 +1619,7 @@ out:
1619} 1619}
1620 1620
1621 1621
1622static struct file_operations via_mixer_fops = { 1622static const struct file_operations via_mixer_fops = {
1623 .owner = THIS_MODULE, 1623 .owner = THIS_MODULE,
1624 .open = via_mixer_open, 1624 .open = via_mixer_open,
1625 .llseek = no_llseek, 1625 .llseek = no_llseek,
@@ -2042,7 +2042,7 @@ static int via_interrupt_init (struct via_info *card)
2042 * 2042 *
2043 */ 2043 */
2044 2044
2045static struct file_operations via_dsp_fops = { 2045static const struct file_operations via_dsp_fops = {
2046 .owner = THIS_MODULE, 2046 .owner = THIS_MODULE,
2047 .open = via_dsp_open, 2047 .open = via_dsp_open,
2048 .release = via_dsp_release, 2048 .release = via_dsp_release,
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index 6dfb9f4b03ec..d25249a932bf 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -3035,7 +3035,7 @@ static int vwsnd_audio_release(struct inode *inode, struct file *file)
3035 return err; 3035 return err;
3036} 3036}
3037 3037
3038static struct file_operations vwsnd_audio_fops = { 3038static const struct file_operations vwsnd_audio_fops = {
3039 .owner = THIS_MODULE, 3039 .owner = THIS_MODULE,
3040 .llseek = no_llseek, 3040 .llseek = no_llseek,
3041 .read = vwsnd_audio_read, 3041 .read = vwsnd_audio_read,
@@ -3225,7 +3225,7 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
3225 return retval; 3225 return retval;
3226} 3226}
3227 3227
3228static struct file_operations vwsnd_mixer_fops = { 3228static const struct file_operations vwsnd_mixer_fops = {
3229 .owner = THIS_MODULE, 3229 .owner = THIS_MODULE,
3230 .llseek = no_llseek, 3230 .llseek = no_llseek,
3231 .ioctl = vwsnd_mixer_ioctl, 3231 .ioctl = vwsnd_mixer_ioctl,
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 8f1ced4ab34c..46daca175502 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -436,7 +436,7 @@ EXPORT_SYMBOL(unregister_sound_dsp);
436 436
437static int soundcore_open(struct inode *, struct file *); 437static int soundcore_open(struct inode *, struct file *);
438 438
439static struct file_operations soundcore_fops= 439static const struct file_operations soundcore_fops=
440{ 440{
441 /* We must have an owner or the module locking fails */ 441 /* We must have an owner or the module locking fails */
442 .owner = THIS_MODULE, 442 .owner = THIS_MODULE,