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/sound_core.c | |
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/sound_core.c')
-rw-r--r-- | sound/sound_core.c | 22 |
1 files changed, 11 insertions, 11 deletions
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) |