Skip to contentSkip to conversation

v4l: vm_area_struct::vm_ops isn't const on pre-2.6.32

PATCH New Laurent Pinchart 1 participant 1 message Nov 20, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l: vm_area_struct::vm_ops isn't const on pre-2.6.32

The vm_area_struct::vm_ops field became const on 2.6.32. All v4l drivers have been changed to declare their vm_operations_struct as const, which introduced warnings when compiling on pre-2.6.32 kernels.

Fix the warnings by not declaring the vm_operations_struct as const on pre-2.6.32 kernels.

kernel-sync

Priority: normal

linux/drivers/media/video/cafe_ccic.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/cafe_ccic.c
@@ -1326,7 +1326,11 @@
 	mutex_unlock(&sbuf->cam->s_mutex);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct cafe_v4l_vm_ops = {
+#else
 static const struct vm_operations_struct cafe_v4l_vm_ops = {
+#endif
 	.open = cafe_v4l_vm_open,
 	.close = cafe_v4l_vm_close
 };
linux/drivers/media/video/et61x251/et61x251_core.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/et61x251/et61x251_core.c
@@ -1500,7 +1500,11 @@
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct et61x251_vm_ops = {
+#else
 static const struct vm_operations_struct et61x251_vm_ops = {
+#endif
 	.open = et61x251_vm_open,
 	.close = et61x251_vm_close,
 };
linux/drivers/media/video/gspca/gspca.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/gspca/gspca.c
@@ -103,7 +103,11 @@
 		frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_MAPPED;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct gspca_vm_ops = {
+#else
 static const struct vm_operations_struct gspca_vm_ops = {
+#endif
 	.open		= gspca_vm_open,
 	.close		= gspca_vm_close,
 };
linux/drivers/media/video/sn9c102/sn9c102_core.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/sn9c102/sn9c102_core.c
@@ -2081,7 +2081,11 @@
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct sn9c102_vm_ops = {
+#else
 static const struct vm_operations_struct sn9c102_vm_ops = {
+#endif
 	.open = sn9c102_vm_open,
 	.close = sn9c102_vm_close,
 };
linux/drivers/media/video/stk-webcam.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/stk-webcam.c
@@ -791,7 +791,11 @@
 	if (sbuf->mapcount == 0)
 		sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_MAPPED;
 }
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct stk_v4l_vm_ops = {
+#else
 static const struct vm_operations_struct stk_v4l_vm_ops = {
+#endif
 	.open = stk_v4l_vm_open,
 	.close = stk_v4l_vm_close
 };
linux/drivers/media/video/uvc/uvc_v4l2.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/uvc/uvc_v4l2.c
@@ -1061,7 +1061,11 @@
 	buffer->vma_use_count--;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct uvc_vm_ops = {
+#else
 static const struct vm_operations_struct uvc_vm_ops = {
+#endif
 	.open		= uvc_vm_open,
 	.close		= uvc_vm_close,
 };
linux/drivers/media/video/videobuf-dma-contig.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/videobuf-dma-contig.c
@@ -107,7 +107,11 @@
 	}
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct videobuf_vm_ops = {
+#else
 static const struct vm_operations_struct videobuf_vm_ops = {
+#endif
 	.open     = videobuf_vm_open,
 	.close    = videobuf_vm_close,
 };
linux/drivers/media/video/videobuf-dma-sg.c +5 -2
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/videobuf-dma-sg.c
@@ -422,8 +422,11 @@
 }
 #endif
 
-static const struct vm_operations_struct videobuf_vm_ops =
-{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct videobuf_vm_ops = {
+#else
+static const struct vm_operations_struct videobuf_vm_ops = {
+#endif
 	.open     = videobuf_vm_open,
 	.close    = videobuf_vm_close,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
linux/drivers/media/video/videobuf-vmalloc.c +5 -2
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/videobuf-vmalloc.c
@@ -117,8 +117,11 @@
 	return;
 }
 
-static const struct vm_operations_struct videobuf_vm_ops =
-{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct videobuf_vm_ops = {
+#else
+static const struct vm_operations_struct videobuf_vm_ops = {
+#endif
 	.open     = videobuf_vm_open,
 	.close    = videobuf_vm_close,
 };
linux/drivers/media/video/zc0301/zc0301_core.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/zc0301/zc0301_core.c
@@ -939,7 +939,11 @@
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct zc0301_vm_ops = {
+#else
 static const struct vm_operations_struct zc0301_vm_ops = {
+#endif
 	.open = zc0301_vm_open,
 	.close = zc0301_vm_close,
 };
linux/drivers/media/video/zoran/zoran_driver.c +4 -0
diff -r 7477df192a59 -r 36e9f5dfbfa5 linux/drivers/media/video/zoran/zoran_driver.c
@@ -3180,7 +3180,11 @@
 	mutex_unlock(&zr->resource_lock);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
+static struct vm_operations_struct zoran_vm_ops = {
+#else
 static const struct vm_operations_struct zoran_vm_ops = {
+#endif
 	.open = zoran_vm_open,
 	.close = zoran_vm_close,
 };
Signature · 1 line
Laurent Pinchart