usb: make video_device const
Subsystems (8)
PATCH v2 1/1 usb: make video_device const
Make these const as they are only used during a copy operation.
Signed-off-by Bhumika Goyal <[email protected]>
---
Changes in v2:
* Combine the patch series sent for drivers/media/usb/ into a single patch.
drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/cpia2/cpia2_v4l.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/s2255/s2255drv.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-)
drivers/media/usb/airspy/airspy.c +1 -1
@@ -859,7 +859,7 @@ static int airspy_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device airspy_template = { +static const struct video_device airspy_template = { .name ="AirSpy SDR" , .release = video_device_release_empty, .fops = &airspy_fops,
drivers/media/usb/cpia2/cpia2_v4l.c +1 -1
@@ -1075,7 +1075,7 @@ static void reset_camera_struct_v4l(struct camera_data *cam) .mmap = cpia2_mmap, }; -static struct video_device cpia2_template = { +static const struct video_device cpia2_template = {/* I could not find any place for the old .initialize initializer?? */ .name ="CPiA2 Camera" , .fops = &cpia2_fops,
drivers/media/usb/go7007/go7007-v4l2.c +1 -1
@@ -901,7 +901,7 @@ static int go7007_s_ctrl(struct v4l2_ctrl *ctrl) .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device go7007_template = { +static const struct video_device go7007_template = { .name ="go7007" , .fops = &go7007_fops, .release = video_device_release_empty,
drivers/media/usb/hackrf/hackrf.c +1 -1
@@ -1263,7 +1263,7 @@ static int hackrf_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device hackrf_template = { +static const struct video_device hackrf_template = { .name ="HackRF One" , .release = video_device_release_empty, .fops = &hackrf_fops,
drivers/media/usb/msi2500/msi2500.c +1 -1
@@ -1143,7 +1143,7 @@ static int msi2500_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device msi2500_template = { +static const struct video_device msi2500_template = { .name ="Mirics MSi3101 SDR Dongle" , .release = video_device_release_empty, .fops = &msi2500_fops,
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +1 -1
@@ -1226,7 +1226,7 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) }; -static struct video_device vdev_template = { +static const struct video_device vdev_template = { .fops = &vdev_fops, };
drivers/media/usb/pwc/pwc-if.c +1 -1
@@ -146,7 +146,7 @@ .mmap = vb2_fop_mmap, .unlocked_ioctl = video_ioctl2, }; -static struct video_device pwc_template = { +static const struct video_device pwc_template = { .name ="Philips Webcam" ,/* Filled in later */ .release = video_device_release_empty, .fops = &pwc_fops,
drivers/media/usb/s2255/s2255drv.c +1 -1
@@ -1590,7 +1590,7 @@ static void s2255_video_device_release(struct video_device *vdev)return ; } -static struct video_device template = { +static const struct video_device template = { .name ="s2255v" , .fops = &s2255_fops_v4l, .ioctl_ops = &s2255_ioctl_ops,
drivers/media/usb/stk1160/stk1160-v4l.c +1 -1
@@ -751,7 +751,7 @@ static void stop_streaming(struct vb2_queue *vq) .wait_finish = vb2_ops_wait_finish, }; -static struct video_device v4l_template = { +static const struct video_device v4l_template = { .name ="stk1160" , .tvnorms =V4L2_STD_525_60 |V4L2_STD_625_50 , .fops = &stk1160_fops,
drivers/media/usb/stkwebcam/stk-webcam.c +1 -1
@@ -1244,7 +1244,7 @@ static void stk_v4l_dev_release(struct video_device *vd)kfree (dev); } -static struct video_device stk_v4l_data = { +static const struct video_device stk_v4l_data = { .name ="stkwebcam" , .fops = &v4l_stk_fops, .ioctl_ops = &v4l_stk_ioctl_ops,
drivers/media/usb/zr364xx/zr364xx.c +1 -1
@@ -1335,7 +1335,7 @@ static unsigned int zr364xx_poll(struct file *file, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device zr364xx_template = { +static const struct video_device zr364xx_template = { .name =DRIVER_DESC , .fops = &zr364xx_fops, .ioctl_ops = &zr364xx_ioctl_ops,
Signature · 1 line
1.9.1
Acked-by Mike Isely <[email protected]>
-Mike
Quoted 165 lines · Bhumika Goyal
Make these const as they are only used during a copy operation.
Signed-off-by Bhumika Goyal <[email protected]>---
Changes in v2:
* Combine the patch series sent fordrivers/media/usb/into a single patch.drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/cpia2/cpia2_v4l.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/s2255/s2255drv.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-)drivers/media/usb/airspy/airspy.c +1
-1@@ -859,7 +859,7 @@ static int airspy_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device airspy_template = { +static const struct video_device airspy_template = { .name ="AirSpy SDR" , .release = video_device_release_empty, .fops = &airspy_fops,drivers/media/usb/cpia2/cpia2_v4l.c +1
-1@@ -1075,7 +1075,7 @@ static void reset_camera_struct_v4l(struct camera_data *cam) .mmap = cpia2_mmap, }; -static struct video_device cpia2_template = { +static const struct video_device cpia2_template = {/* I could not find any place for the old .initialize initializer?? */ .name ="CPiA2 Camera" , .fops = &cpia2_fops,drivers/media/usb/go7007/go7007-v4l2.c +1
-1@@ -901,7 +901,7 @@ static int go7007_s_ctrl(struct v4l2_ctrl *ctrl) .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device go7007_template = { +static const struct video_device go7007_template = { .name ="go7007" , .fops = &go7007_fops, .release = video_device_release_empty,drivers/media/usb/hackrf/hackrf.c +1
-1@@ -1263,7 +1263,7 @@ static int hackrf_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device hackrf_template = { +static const struct video_device hackrf_template = { .name ="HackRF One" , .release = video_device_release_empty, .fops = &hackrf_fops,drivers/media/usb/msi2500/msi2500.c +1
-1@@ -1143,7 +1143,7 @@ static int msi2500_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device msi2500_template = { +static const struct video_device msi2500_template = { .name ="Mirics MSi3101 SDR Dongle" , .release = video_device_release_empty, .fops = &msi2500_fops,drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +1
-1@@ -1226,7 +1226,7 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) }; -static struct video_device vdev_template = { +static const struct video_device vdev_template = { .fops = &vdev_fops, };drivers/media/usb/pwc/pwc-if.c +1
-1@@ -146,7 +146,7 @@ .mmap = vb2_fop_mmap, .unlocked_ioctl = video_ioctl2, }; -static struct video_device pwc_template = { +static const struct video_device pwc_template = { .name ="Philips Webcam" ,/* Filled in later */ .release = video_device_release_empty, .fops = &pwc_fops,drivers/media/usb/s2255/s2255drv.c +1
-1@@ -1590,7 +1590,7 @@ static void s2255_video_device_release(struct video_device *vdev)return ; } -static struct video_device template = { +static const struct video_device template = { .name ="s2255v" , .fops = &s2255_fops_v4l, .ioctl_ops = &s2255_ioctl_ops,drivers/media/usb/stk1160/stk1160-v4l.c +1
-1@@ -751,7 +751,7 @@ static void stop_streaming(struct vb2_queue *vq) .wait_finish = vb2_ops_wait_finish, }; -static struct video_device v4l_template = { +static const struct video_device v4l_template = { .name ="stk1160" , .tvnorms =V4L2_STD_525_60 |V4L2_STD_625_50 , .fops = &stk1160_fops,drivers/media/usb/stkwebcam/stk-webcam.c +1
-1@@ -1244,7 +1244,7 @@ static void stk_v4l_dev_release(struct video_device *vd)kfree (dev); } -static struct video_device stk_v4l_data = { +static const struct video_device stk_v4l_data = { .name ="stkwebcam" , .fops = &v4l_stk_fops, .ioctl_ops = &v4l_stk_ioctl_ops,drivers/media/usb/zr364xx/zr364xx.c +1
-1@@ -1335,7 +1335,7 @@ static unsigned int zr364xx_poll(struct file *file, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device zr364xx_template = { +static const struct video_device zr364xx_template = { .name =DRIVER_DESC , .fops = &zr364xx_fops, .ioctl_ops = &zr364xx_ioctl_ops,
Signature · 3 lines
Mike Isely isely @ isely (dot) net PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8