Skip to contentSkip to conversation

media: smiapp: Remove unused loop

PATCH In review Ricardo Ribalda Delgado 2 participants 2 messages Sep 26, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: smiapp: Remove unused loop

The loop seemed to be made to calculate max, but max is not used in that function.

---
 drivers/media/i2c/smiapp/smiapp-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/i2c/smiapp/smiapp-core.c +1 -3
index 99f3b295ae3c..bccbf4c841d6 100644
@@ -624,7 +624,7 @@ static int smiapp_init_late_controls(struct smiapp_sensor *sensor)
 {
 	unsigned long *valid_link_freqs = &sensor->valid_link_freqs[
 		sensor->csi_format->compressed - sensor->compressed_min_bpp];
-	unsigned int max, i;
+	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++) {
 		int max_value = (1 << sensor->csi_format->width) - 1;
@@ -635,8 +635,6 @@ static int smiapp_init_late_controls(struct smiapp_sensor *sensor)
 				0, max_value, 1, max_value);
 	}
 
-	for (max = 0; sensor->hwcfg->op_sys_clock[max + 1]; max++);
-
 	sensor->link_freq = v4l2_ctrl_new_int_menu(
 		&sensor->src->ctrl_handler, &smiapp_ctrl_ops,
 		V4L2_CID_LINK_FREQ, __fls(*valid_link_freqs),
Signature · 1 line
2.19.0
#1 lore raw

Hi Ricardo,

Quoted 4 lines · Ricardo Ribalda Delgado

The loop seemed to be made to calculate max, but max is not used in that function.

The code has been left there probably when the valid link frequency calculation was changed.

Thanks!

Quoted 29 lines
---
 drivers/media/i2c/smiapp/smiapp-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/i2c/smiapp/smiapp-core.c +1 -3
index 99f3b295ae3c..bccbf4c841d6 100644
@@ -624,7 +624,7 @@ static int smiapp_init_late_controls(struct smiapp_sensor *sensor)
 {
 	unsigned long *valid_link_freqs = &sensor->valid_link_freqs[
 		sensor->csi_format->compressed - sensor->compressed_min_bpp];
-	unsigned int max, i;
+	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++) {
 		int max_value = (1 << sensor->csi_format->width) - 1;
@@ -635,8 +635,6 @@ static int smiapp_init_late_controls(struct smiapp_sensor *sensor)
 				0, max_value, 1, max_value);
 	}
 
-	for (max = 0; sensor->hwcfg->op_sys_clock[max + 1]; max++);
-
 	sensor->link_freq = v4l2_ctrl_new_int_menu(
 		&sensor->src->ctrl_handler, &smiapp_ctrl_ops,
 		V4L2_CID_LINK_FREQ, __fls(*valid_link_freqs),
Signature · 1 line
2.19.0
Signature · 2 lines
Sakari Ailus
e-mail: [email protected]