All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: smiapp: Remove unused loop
@ 2018-09-26  6:12 Ricardo Ribalda Delgado
  2018-09-26  7:20 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Ribalda Delgado @ 2018-09-26  6:12 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, linux-media; +Cc: Ricardo Ribalda Delgado

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

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 99f3b295ae3c..bccbf4c841d6 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -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),
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: smiapp: Remove unused loop
  2018-09-26  6:12 [PATCH] media: smiapp: Remove unused loop Ricardo Ribalda Delgado
@ 2018-09-26  7:20 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2018-09-26  7:20 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado; +Cc: Mauro Carvalho Chehab, linux-media

Hi Ricardo,

On Wed, Sep 26, 2018 at 08:12:42AM +0200, Ricardo Ribalda Delgado wrote:
> The loop seemed to be made to calculate max, but max is not used in that
> function.
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

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

Thanks!

> ---
>  drivers/media/i2c/smiapp/smiapp-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
> index 99f3b295ae3c..bccbf4c841d6 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -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),
> -- 
> 2.19.0
> 

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-26 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26  6:12 [PATCH] media: smiapp: Remove unused loop Ricardo Ribalda Delgado
2018-09-26  7:20 ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.