Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
d034731b d13ee586

+5 -4
+5 -4
drivers/media/test-drivers/vivid/vivid-core.c
··· 1315 1315 unsigned out_type_counter[4]) 1316 1316 { 1317 1317 struct video_device *vfd; 1318 - int ret, i; 1318 + int ret; 1319 1319 1320 1320 if (dev->has_vid_cap) { 1321 1321 vfd = &dev->vid_cap_dev; ··· 1365 1365 } 1366 1366 1367 1367 if (dev->has_vid_out) { 1368 + #ifdef CONFIG_VIDEO_VIVID_CEC 1369 + int i; 1370 + #endif 1368 1371 vfd = &dev->vid_out_dev; 1369 1372 snprintf(vfd->name, sizeof(vfd->name), 1370 1373 "vivid-%03d-vid-out", inst); ··· 1662 1659 struct vivid_dev *dev; 1663 1660 unsigned node_type = node_types[inst]; 1664 1661 v4l2_std_id tvnorms_cap = 0, tvnorms_out = 0; 1662 + unsigned int cec_tx_bus_cnt = 0; 1665 1663 int ret; 1666 1664 int i; 1667 - #ifdef CONFIG_VIDEO_VIVID_CEC 1668 - unsigned int cec_tx_bus_cnt = 0; 1669 - #endif 1670 1665 1671 1666 /* allocate main vivid state structure */ 1672 1667 dev = kzalloc(sizeof(*dev), GFP_KERNEL);