Skip to contentSkip to conversation

mt9v111: Fix compiler warning by initialising a variable

PATCH In review Sakari Ailus 2 participants 3 messages Jul 30, 2018

Subsystems (3)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 mt9v111: Fix compiler warning by initialising a variable

While this isn't a bug, initialise the variable to quash the warning.

---
 drivers/media/i2c/mt9v111.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9v111.c +1 -1
index da8f6ab91307..58d5f2224bff 100644
@@ -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);
Signature · 1 line
2.11.0
maintainer
#1 lore raw

Hi Sakari,

Quoted 13 lines · Sakari Ailus

While this isn't a bug, initialise the variable to quash the warning.

---
 drivers/media/i2c/mt9v111.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9v111.c +0 -0
index da8f6ab91307..58d5f2224bff 100644

drivers/media/i2c/mt9v111.c static int mt9v111_set_format(struct v4l2_subdev *subdev, · line 889

Quoted 7 lines
drivers/media/i2c/mt9v111.c +1 -1
@@ -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;
 

Thanks for this, but there is already a patch sent on Friday by Jasmin addressing the warning

https://patchwork.kernel.org/patch/10547983/

Quoted 4 lines
drivers/media/i2c/mt9v111.c +0 -1
 	mutex_lock(&mt9v111->stream_mutex);
--

2.11.0

author maintainer
#2 lore raw
Quoted 27 lines · jacopo mondi

Hi Sakari,

Quoted 13 lines · Sakari Ailus

While this isn't a bug, initialise the variable to quash the warning.

---
 drivers/media/i2c/mt9v111.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9v111.c +0 -0
index da8f6ab91307..58d5f2224bff 100644

drivers/media/i2c/mt9v111.c static int mt9v111_set_format(struct v4l2_subdev *subdev, · line 889

Quoted 7 lines
drivers/media/i2c/mt9v111.c +1 -1
@@ -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;
 

Thanks for this, but there is already a patch sent on Friday by Jasmin addressing the warning

Quoted 1 line

https://patchwork.kernel.org/patch/10547983/

Ah, ok. I'll mark this as rejected then.

Signature · 2 lines
Sakari Ailus
[email protected]