diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2020-09-08 12:03:04 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-08 12:54:00 +0300 |
commit | d034731bb4b4f2bf5f378231a6d99e59c2cb59f6 (patch) | |
tree | 802da59ebb49d75b6728d43ee191a0190a9ee6dc /drivers/media/test-drivers/vivid/vivid-core.c | |
parent | d13ee586e026e8166231e03e5345718ebf625c02 (diff) | |
download | linux-d034731bb4b4f2bf5f378231a6d99e59c2cb59f6.tar.xz |
media: vivid: fix compile warning/error
Fix this warning:
vivid-core.c: In function 'vivid_create_devnodes':
vivid-core.c:1318:11: warning: unused variable 'i' [-Wunused-variable]
1318 | int ret, i;
| ^
and this error:
vivid-core.c: In function 'vivid_create_instance':
vivid-core.c:1885:47: error: 'cec_tx_bus_cnt' undeclared (first use in this function)
1885 | ret = vivid_create_devnodes(pdev, dev, inst, cec_tx_bus_cnt,
| ^~~~~~~~~~~~~~
vivid-core.c:1885:47: note: each undeclared identifier is reported only once for each function it appears in
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vivid/vivid-core.c')
-rw-r--r-- | drivers/media/test-drivers/vivid/vivid-core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 48809991f037..aa8d350fd682 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -1315,7 +1315,7 @@ static int vivid_create_devnodes(struct platform_device *pdev, unsigned out_type_counter[4]) { struct video_device *vfd; - int ret, i; + int ret; if (dev->has_vid_cap) { vfd = &dev->vid_cap_dev; @@ -1365,6 +1365,9 @@ static int vivid_create_devnodes(struct platform_device *pdev, } if (dev->has_vid_out) { +#ifdef CONFIG_VIDEO_VIVID_CEC + int i; +#endif vfd = &dev->vid_out_dev; snprintf(vfd->name, sizeof(vfd->name), "vivid-%03d-vid-out", inst); @@ -1659,11 +1662,9 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) struct vivid_dev *dev; unsigned node_type = node_types[inst]; v4l2_std_id tvnorms_cap = 0, tvnorms_out = 0; + unsigned int cec_tx_bus_cnt = 0; int ret; int i; -#ifdef CONFIG_VIDEO_VIVID_CEC - unsigned int cec_tx_bus_cnt = 0; -#endif /* allocate main vivid state structure */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); |