From 4effa8bfe4f6bacd041f98775f49cdc550502dc2 Mon Sep 17 00:00:00 2001 From: Jasmin Jessich Date: Sat, 28 Jul 2018 09:54:49 -0400 Subject: media: i2c: fix warning in Aptina MT9V111 This fixes the "'idx' may be used uninitialized in this function" warning: drivers/media/i2c/mt9v111.c: In function 'mt9v111_set_format': drivers/media/i2c/mt9v111.c:887:15: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized] unsigned int idx; ^~~ Signed-off-by: Jasmin Jessich Acked-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/mt9v111.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/i2c/mt9v111.c') diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c index da8f6ab91307..58d5f2224bff 100644 --- a/drivers/media/i2c/mt9v111.c +++ b/drivers/media/i2c/mt9v111.c @@ -884,7 +884,7 @@ static int mt9v111_set_format(struct v4l2_subdev *subdev, struct v4l2_mbus_framefmt new_fmt; struct v4l2_mbus_framefmt *__fmt; unsigned int best_fit = ~0L; - unsigned int idx; + unsigned int idx = 0; unsigned int i; mutex_lock(&mt9v111->stream_mutex); -- cgit v1.2.3