Skip to content

Commit

Permalink
[media] saa7146: make saa7146_use_ops const
Browse files Browse the repository at this point in the history
Make these const as they are not modified in the file referencing them.
They are only used when their function pointer fields invokes a
function and therefore none of the structure fields are getting modified.
Also, add a const to the declaration in the header.

Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
goyalbhumika authored and mchehab committed Oct 4, 2017
1 parent 0225652 commit ad62701
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/media/common/saa7146/saa7146_vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff
return ret;
}

struct saa7146_use_ops saa7146_vbi_uops = {
const struct saa7146_use_ops saa7146_vbi_uops = {
.init = vbi_init,
.open = vbi_open,
.release = vbi_close,
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/common/saa7146/saa7146_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
return ret;
}

struct saa7146_use_ops saa7146_video_uops = {
const struct saa7146_use_ops saa7146_video_uops = {
.init = video_init,
.open = video_open,
.release = video_close,
Expand Down
4 changes: 2 additions & 2 deletions include/media/drv-intf/saa7146_vv.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data);
/* from saa7146_video.c */
extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops;
extern const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops;
extern struct saa7146_use_ops saa7146_video_uops;
extern const struct saa7146_use_ops saa7146_video_uops;
int saa7146_start_preview(struct saa7146_fh *fh);
int saa7146_stop_preview(struct saa7146_fh *fh);
long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
int saa7146_s_ctrl(struct v4l2_ctrl *ctrl);

/* from saa7146_vbi.c */
extern struct saa7146_use_ops saa7146_vbi_uops;
extern const struct saa7146_use_ops saa7146_vbi_uops;

/* resource management functions */
int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit);
Expand Down

0 comments on commit ad62701

Please sign in to comment.