[PATCH] mark struct file_operations const 1

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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Arjan van de Ven 2007-02-12 00:55:28 -08:00 • committed by Linus Torvalds
commit 540473208f
9 changed files with 13 additions and 13 deletions

View file

@ -447,7 +447,7 @@ struct snd_pcm_notify {
* Registering
*/
extern struct file_operations snd_pcm_f_ops[2];
extern const struct file_operations snd_pcm_f_ops[2];
int snd_pcm_new(struct snd_card *card, char *id, int device,
int playback_count, int capture_count,