Browse Source

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 <jasmin@anw.at>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Jasmin Jessich 7 years ago
parent
commit
4effa8bfe4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/media/i2c/mt9v111.c

+ 1 - 1
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);