Skip to content

Commit d034731

Browse files
Hans Verkuilmchehab
authored andcommitted
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>
1 parent d13ee58 commit d034731

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/media/test-drivers/vivid/vivid-core.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ static int vivid_create_devnodes(struct platform_device *pdev,
13151315
unsigned out_type_counter[4])
13161316
{
13171317
struct video_device *vfd;
1318-
int ret, i;
1318+
int ret;
13191319

13201320
if (dev->has_vid_cap) {
13211321
vfd = &dev->vid_cap_dev;
@@ -1365,6 +1365,9 @@ static int vivid_create_devnodes(struct platform_device *pdev,
13651365
}
13661366

13671367
if (dev->has_vid_out) {
1368+
#ifdef CONFIG_VIDEO_VIVID_CEC
1369+
int i;
1370+
#endif
13681371
vfd = &dev->vid_out_dev;
13691372
snprintf(vfd->name, sizeof(vfd->name),
13701373
"vivid-%03d-vid-out", inst);
@@ -1659,11 +1662,9 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
16591662
struct vivid_dev *dev;
16601663
unsigned node_type = node_types[inst];
16611664
v4l2_std_id tvnorms_cap = 0, tvnorms_out = 0;
1665+
unsigned int cec_tx_bus_cnt = 0;
16621666
int ret;
16631667
int i;
1664-
#ifdef CONFIG_VIDEO_VIVID_CEC
1665-
unsigned int cec_tx_bus_cnt = 0;
1666-
#endif
16671668

16681669
/* allocate main vivid state structure */
16691670
dev = kzalloc(sizeof(*dev), GFP_KERNEL);

0 commit comments

Comments
 (0)