usb: gadget: f_uvc: make uvc_v4l2_fops const
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 27 Sep 2017 17:27:07 +0000 (22:57 +0530)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 19 Oct 2017 07:38:09 +0000 (10:38 +0300)
Make this const as it is only stored in the const field of a structure
video_device in the file referencing it. Make the declaration const too.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/uvc_v4l2.c
drivers/usb/gadget/function/uvc_v4l2.h

index 3e22b45687d37d8f256f0f1524af0e390434bf14..66124024278bf302769336ceb2a3edcbe96e284e 100644 (file)
@@ -354,7 +354,7 @@ static unsigned long uvcg_v4l2_get_unmapped_area(struct file *file,
 }
 #endif
 
-struct v4l2_file_operations uvc_v4l2_fops = {
+const struct v4l2_file_operations uvc_v4l2_fops = {
        .owner          = THIS_MODULE,
        .open           = uvc_v4l2_open,
        .release        = uvc_v4l2_release,
index 2683b92fda658c3623120086b86e3c19013c7b57..ad6ca067174035e8474917227f2d55560cb00357 100644 (file)
@@ -17,6 +17,6 @@
 #define __UVC_V4L2_H__
 
 extern const struct v4l2_ioctl_ops uvc_v4l2_ioctl_ops;
-extern struct v4l2_file_operations uvc_v4l2_fops;
+extern const struct v4l2_file_operations uvc_v4l2_fops;
 
 #endif /* __UVC_V4L2_H__ */