diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-28 04:56:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 12:16:05 -0500 |
commit | 99ac48f54a91d02140c497edc31dc57d4bc5c85d (patch) | |
tree | 68719391694a6914191bdf73d2071875f7653f6f /sound | |
parent | ec1b9466cb4f6ae6d950bd67055d9410d1056d2a (diff) |
[PATCH] mark f_ops const in the inode
Mark the f_ops members of inodes as const, as well as fix the
ripple-through this causes by places that copy this f_ops and then "do
stuff" with it.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/init.c | 3 | ||||
-rw-r--r-- | sound/core/sound.c | 4 | ||||
-rw-r--r-- | sound/core/sound_oss.c | 2 | ||||
-rw-r--r-- | sound/sound_core.c | 22 |
4 files changed, 16 insertions, 15 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index ad68761abba1..5bb8a8b23d51 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -223,7 +223,8 @@ int snd_card_disconnect(struct snd_card *card) | |||
223 | struct snd_monitor_file *mfile; | 223 | struct snd_monitor_file *mfile; |
224 | struct file *file; | 224 | struct file *file; |
225 | struct snd_shutdown_f_ops *s_f_ops; | 225 | struct snd_shutdown_f_ops *s_f_ops; |
226 | struct file_operations *f_ops, *old_f_ops; | 226 | struct file_operations *f_ops; |
227 | const struct file_operations *old_f_ops; | ||
227 | int err; | 228 | int err; |
228 | 229 | ||
229 | spin_lock(&card->files_lock); | 230 | spin_lock(&card->files_lock); |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 4d28e5212611..108e430b5036 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -137,7 +137,7 @@ static int snd_open(struct inode *inode, struct file *file) | |||
137 | { | 137 | { |
138 | unsigned int minor = iminor(inode); | 138 | unsigned int minor = iminor(inode); |
139 | struct snd_minor *mptr = NULL; | 139 | struct snd_minor *mptr = NULL; |
140 | struct file_operations *old_fops; | 140 | const struct file_operations *old_fops; |
141 | int err = 0; | 141 | int err = 0; |
142 | 142 | ||
143 | if (minor >= ARRAY_SIZE(snd_minors)) | 143 | if (minor >= ARRAY_SIZE(snd_minors)) |
@@ -240,7 +240,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) | |||
240 | * Retrurns zero if successful, or a negative error code on failure. | 240 | * Retrurns zero if successful, or a negative error code on failure. |
241 | */ | 241 | */ |
242 | int snd_register_device(int type, struct snd_card *card, int dev, | 242 | int snd_register_device(int type, struct snd_card *card, int dev, |
243 | struct file_operations *f_ops, void *private_data, | 243 | const struct file_operations *f_ops, void *private_data, |
244 | const char *name) | 244 | const char *name) |
245 | { | 245 | { |
246 | int minor; | 246 | int minor; |
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index 4023d3b406de..9055c6de9587 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c | |||
@@ -95,7 +95,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev) | |||
95 | } | 95 | } |
96 | 96 | ||
97 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 97 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
98 | struct file_operations *f_ops, void *private_data, | 98 | const struct file_operations *f_ops, void *private_data, |
99 | const char *name) | 99 | const char *name) |
100 | { | 100 | { |
101 | int minor = snd_oss_kernel_minor(type, card, dev); | 101 | int minor = snd_oss_kernel_minor(type, card, dev); |
diff --git a/sound/sound_core.c b/sound/sound_core.c index 394b53e20cb8..6f849720aef3 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -53,7 +53,7 @@ | |||
53 | struct sound_unit | 53 | struct sound_unit |
54 | { | 54 | { |
55 | int unit_minor; | 55 | int unit_minor; |
56 | struct file_operations *unit_fops; | 56 | const struct file_operations *unit_fops; |
57 | struct sound_unit *next; | 57 | struct sound_unit *next; |
58 | char name[32]; | 58 | char name[32]; |
59 | }; | 59 | }; |
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(sound_class); | |||
73 | * join into it. Called with the lock asserted | 73 | * join into it. Called with the lock asserted |
74 | */ | 74 | */ |
75 | 75 | ||
76 | static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list, struct file_operations *fops, int index, int low, int top) | 76 | static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list, const struct file_operations *fops, int index, int low, int top) |
77 | { | 77 | { |
78 | int n=low; | 78 | int n=low; |
79 | 79 | ||
@@ -153,7 +153,7 @@ static DEFINE_SPINLOCK(sound_loader_lock); | |||
153 | * list. Acquires locks as needed | 153 | * list. Acquires locks as needed |
154 | */ | 154 | */ |
155 | 155 | ||
156 | static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev) | 156 | static int sound_insert_unit(struct sound_unit **list, const struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev) |
157 | { | 157 | { |
158 | struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL); | 158 | struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL); |
159 | int r; | 159 | int r; |
@@ -237,7 +237,7 @@ static struct sound_unit *chains[SOUND_STEP]; | |||
237 | * a negative error code is returned. | 237 | * a negative error code is returned. |
238 | */ | 238 | */ |
239 | 239 | ||
240 | int register_sound_special_device(struct file_operations *fops, int unit, | 240 | int register_sound_special_device(const struct file_operations *fops, int unit, |
241 | struct device *dev) | 241 | struct device *dev) |
242 | { | 242 | { |
243 | const int chain = unit % SOUND_STEP; | 243 | const int chain = unit % SOUND_STEP; |
@@ -301,7 +301,7 @@ int register_sound_special_device(struct file_operations *fops, int unit, | |||
301 | 301 | ||
302 | EXPORT_SYMBOL(register_sound_special_device); | 302 | EXPORT_SYMBOL(register_sound_special_device); |
303 | 303 | ||
304 | int register_sound_special(struct file_operations *fops, int unit) | 304 | int register_sound_special(const struct file_operations *fops, int unit) |
305 | { | 305 | { |
306 | return register_sound_special_device(fops, unit, NULL); | 306 | return register_sound_special_device(fops, unit, NULL); |
307 | } | 307 | } |
@@ -318,7 +318,7 @@ EXPORT_SYMBOL(register_sound_special); | |||
318 | * number is returned, on failure a negative error code is returned. | 318 | * number is returned, on failure a negative error code is returned. |
319 | */ | 319 | */ |
320 | 320 | ||
321 | int register_sound_mixer(struct file_operations *fops, int dev) | 321 | int register_sound_mixer(const struct file_operations *fops, int dev) |
322 | { | 322 | { |
323 | return sound_insert_unit(&chains[0], fops, dev, 0, 128, | 323 | return sound_insert_unit(&chains[0], fops, dev, 0, 128, |
324 | "mixer", S_IRUSR | S_IWUSR, NULL); | 324 | "mixer", S_IRUSR | S_IWUSR, NULL); |
@@ -336,7 +336,7 @@ EXPORT_SYMBOL(register_sound_mixer); | |||
336 | * number is returned, on failure a negative error code is returned. | 336 | * number is returned, on failure a negative error code is returned. |
337 | */ | 337 | */ |
338 | 338 | ||
339 | int register_sound_midi(struct file_operations *fops, int dev) | 339 | int register_sound_midi(const struct file_operations *fops, int dev) |
340 | { | 340 | { |
341 | return sound_insert_unit(&chains[2], fops, dev, 2, 130, | 341 | return sound_insert_unit(&chains[2], fops, dev, 2, 130, |
342 | "midi", S_IRUSR | S_IWUSR, NULL); | 342 | "midi", S_IRUSR | S_IWUSR, NULL); |
@@ -362,7 +362,7 @@ EXPORT_SYMBOL(register_sound_midi); | |||
362 | * and will always allocate them as a matching pair - eg dsp3/audio3 | 362 | * and will always allocate them as a matching pair - eg dsp3/audio3 |
363 | */ | 363 | */ |
364 | 364 | ||
365 | int register_sound_dsp(struct file_operations *fops, int dev) | 365 | int register_sound_dsp(const struct file_operations *fops, int dev) |
366 | { | 366 | { |
367 | return sound_insert_unit(&chains[3], fops, dev, 3, 131, | 367 | return sound_insert_unit(&chains[3], fops, dev, 3, 131, |
368 | "dsp", S_IWUSR | S_IRUSR, NULL); | 368 | "dsp", S_IWUSR | S_IRUSR, NULL); |
@@ -381,7 +381,7 @@ EXPORT_SYMBOL(register_sound_dsp); | |||
381 | */ | 381 | */ |
382 | 382 | ||
383 | 383 | ||
384 | int register_sound_synth(struct file_operations *fops, int dev) | 384 | int register_sound_synth(const struct file_operations *fops, int dev) |
385 | { | 385 | { |
386 | return sound_insert_unit(&chains[9], fops, dev, 9, 137, | 386 | return sound_insert_unit(&chains[9], fops, dev, 9, 137, |
387 | "synth", S_IRUSR | S_IWUSR, NULL); | 387 | "synth", S_IRUSR | S_IWUSR, NULL); |
@@ -501,7 +501,7 @@ int soundcore_open(struct inode *inode, struct file *file) | |||
501 | int chain; | 501 | int chain; |
502 | int unit = iminor(inode); | 502 | int unit = iminor(inode); |
503 | struct sound_unit *s; | 503 | struct sound_unit *s; |
504 | struct file_operations *new_fops = NULL; | 504 | const struct file_operations *new_fops = NULL; |
505 | 505 | ||
506 | chain=unit&0x0F; | 506 | chain=unit&0x0F; |
507 | if(chain==4 || chain==5) /* dsp/audio/dsp16 */ | 507 | if(chain==4 || chain==5) /* dsp/audio/dsp16 */ |
@@ -540,7 +540,7 @@ int soundcore_open(struct inode *inode, struct file *file) | |||
540 | * switching ->f_op in the first place. | 540 | * switching ->f_op in the first place. |
541 | */ | 541 | */ |
542 | int err = 0; | 542 | int err = 0; |
543 | struct file_operations *old_fops = file->f_op; | 543 | const struct file_operations *old_fops = file->f_op; |
544 | file->f_op = new_fops; | 544 | file->f_op = new_fops; |
545 | spin_unlock(&sound_loader_lock); | 545 | spin_unlock(&sound_loader_lock); |
546 | if(file->f_op->open) | 546 | if(file->f_op->open) |