Commit 5303135c authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Mauro Carvalho Chehab
Browse files

media: platform: make video_device const



Make these const as they are only used during a copy operation.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
@@
static struct video_device s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier match.s;
expression list[3] es;
position ref.p;
@@
cx88_vdev_init(es,&s@p,...)

@good2@
position ref.p;
identifier match.s,f,c;
expression e;
@@
(
e = s@p
|
e = s@p.f
|
c(...,s@p.f,...)
|
c(...,s@p,...)
)

@bad depends on  !good1 && !good2@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct video_device s;

Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3db4b68e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1380,7 +1380,7 @@ static const struct v4l2_ioctl_ops viu_ioctl_ops = {
	.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
};

static struct video_device viu_template = {
static const struct video_device viu_template = {
	.name		= "FSL viu",
	.fops		= &viu_fops,
	.minor		= -1,
+1 −1
Original line number Diff line number Diff line
@@ -979,7 +979,7 @@ static const struct v4l2_file_operations deinterlace_fops = {
	.mmap		= deinterlace_mmap,
};

static struct video_device deinterlace_videodev = {
static const struct video_device deinterlace_videodev = {
	.name		= MEM2MEM_NAME,
	.fops		= &deinterlace_fops,
	.ioctl_ops	= &deinterlace_ioctl_ops,
+1 −1
Original line number Diff line number Diff line
@@ -1639,7 +1639,7 @@ static const struct v4l2_file_operations mcam_v4l_fops = {
 * This template device holds all of those v4l2 methods; we
 * clone it for specific real devices.
 */
static struct video_device mcam_v4l_template = {
static const struct video_device mcam_v4l_template = {
	.name = "mcam",
	.fops = &mcam_v4l_fops,
	.ioctl_ops = &mcam_v4l_ioctl_ops,
+1 −1
Original line number Diff line number Diff line
@@ -873,7 +873,7 @@ static const struct v4l2_file_operations emmaprp_fops = {
	.mmap		= emmaprp_mmap,
};

static struct video_device emmaprp_videodev = {
static const struct video_device emmaprp_videodev = {
	.name		= MEM2MEM_NAME,
	.fops		= &emmaprp_fops,
	.ioctl_ops	= &emmaprp_ioctl_ops,
+1 −1
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ static const struct v4l2_ioctl_ops g2d_ioctl_ops = {
	.vidioc_cropcap			= vidioc_cropcap,
};

static struct video_device g2d_videodev = {
static const struct video_device g2d_videodev = {
	.name		= G2D_NAME,
	.fops		= &g2d_fops,
	.ioctl_ops	= &g2d_ioctl_ops,
Loading