From fa027c2a0a0d6d1df6b29ee99048502c93da0dd4 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:33 -0800 Subject: [PATCH] mark struct file_operations const 4 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. [akpm@sdl.org: dvb fix] Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/usbvideo/usbvideo.c | 2 +- drivers/media/video/usbvideo/vicam.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/usbvideo') diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index b560c9d7c516..d34d8c8b7376 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c @@ -945,7 +945,7 @@ static int usbvideo_find_struct(struct usbvideo *cams) return rv; } -static struct file_operations usbvideo_fops = { +static const struct file_operations usbvideo_fops = { .owner = THIS_MODULE, .open = usbvideo_v4l_open, .release =usbvideo_v4l_close, diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index 08f9559a6bfa..876fd2768242 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c @@ -1234,7 +1234,7 @@ static inline void vicam_create_proc_entry(struct vicam_camera *cam) { } static inline void vicam_destroy_proc_entry(void *ptr) { } #endif -static struct file_operations vicam_fops = { +static const struct file_operations vicam_fops = { .owner = THIS_MODULE, .open = vicam_open, .release = vicam_close, -- cgit v1.2.2