Skip to contentSkip to conversation

vb2: make vb2_ops

PATCH New Bhumika Goyal 1 participant 1 message Sep 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vb2: make vb2_ops

Make vb2_ops const as they are only stored in the const field of a vb2_queue structure. Make the declarations const too.

Done using Coccinelle.

---
 drivers/media/usb/au0828/au0828-vbi.c | 2 +-
 drivers/media/usb/au0828/au0828.h     | 2 +-
 drivers/media/usb/em28xx/em28xx-v4l.h | 2 +-
 drivers/media/usb/em28xx/em28xx-vbi.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/media/usb/au0828/au0828-vbi.c +1 -1
index e0930ce..9dd6bdb 100644
@@ -79,7 +79,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb)
 	spin_unlock_irqrestore(&dev->slock, flags);
 }
 
-struct vb2_ops au0828_vbi_qops = {
+const struct vb2_ops au0828_vbi_qops = {
 	.queue_setup     = vbi_queue_setup,
 	.buf_prepare     = vbi_buffer_prepare,
 	.buf_queue       = vbi_buffer_queue,
drivers/media/usb/au0828/au0828.h +1 -1
index 05e445f..f6f37e8 100644
@@ -358,7 +358,7 @@ static inline int au0828_analog_unregister(struct au0828_dev *dev)
 void au0828_dvb_resume(struct au0828_dev *dev);
 
 /* au0828-vbi.c */
-extern struct vb2_ops au0828_vbi_qops;
+extern const struct vb2_ops au0828_vbi_qops;
 
 #define dprintk(level, fmt, arg...)\
 	do { if (au0828_debug & level)\
drivers/media/usb/em28xx/em28xx-v4l.h +1 -1
index 8dfcb56..9c411aa 100644
@@ -16,4 +16,4 @@
 
 int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count);
 void em28xx_stop_vbi_streaming(struct vb2_queue *vq);
-extern struct vb2_ops em28xx_vbi_qops;
+extern const struct vb2_ops em28xx_vbi_qops;
drivers/media/usb/em28xx/em28xx-vbi.c +1 -1
index 0bac552..f512365 100644
@@ -93,7 +93,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb)
 	spin_unlock_irqrestore(&dev->slock, flags);
 }
 
-struct vb2_ops em28xx_vbi_qops = {
+const struct vb2_ops em28xx_vbi_qops = {
 	.queue_setup    = vbi_queue_setup,
 	.buf_prepare    = vbi_buffer_prepare,
 	.buf_queue      = vbi_buffer_queue,
Signature · 1 line
1.9.1