All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] Staging: media: imx: eliminate unused code
@ 2020-03-13 17:21 Enrique Vargas
  2020-03-14  0:54 ` Steve Longerbeam
  2020-03-17  1:05 ` [Outreachy kernel] " Stefano Brivio
  0 siblings, 2 replies; 3+ messages in thread
From: Enrique Vargas @ 2020-03-13 17:21 UTC (permalink / raw)
  To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	outreachy-kernel

Eliminate code that is never used inside #ifdef 0 / #endif.  This eliminates WARNING found using checkpatch.

Signed-off-by: Enrique Vargas <jevargas@seas.upenn.edu>
---
v2 Fix description typo with broken line
v3 Include change control, as suggested by Greg.

 drivers/staging/media/imx/imx-media-csi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index b60ed4f22f6d..2001f7851e90 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1131,13 +1131,7 @@ static int csi_link_validate(struct v4l2_subdev *sd,
 		 * enters the CSI's however, they are treated internally
 		 * in the IPU as virtual channel 0.
 		 */
-#if 0
-		mutex_unlock(&priv->lock);
-		vc_num = imx_media_find_mipi_csi2_channel(&priv->sd.entity);
-		if (vc_num < 0)
-			return vc_num;
-		mutex_lock(&priv->lock);
-#endif
+
 		ipu_csi_set_mipi_datatype(priv->csi, vc_num,
 					  &priv->format_mbus[CSI_SINK_PAD]);
 	}
-- 
2.17.1



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

* Re: [PATCH v3] Staging: media: imx: eliminate unused code
  2020-03-13 17:21 [PATCH v3] Staging: media: imx: eliminate unused code Enrique Vargas
@ 2020-03-14  0:54 ` Steve Longerbeam
  2020-03-17  1:05 ` [Outreachy kernel] " Stefano Brivio
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Longerbeam @ 2020-03-14  0:54 UTC (permalink / raw)
  To: Enrique Vargas, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	outreachy-kernel



On 3/13/20 10:21 AM, Enrique Vargas wrote:
> Eliminate code that is never used inside #ifdef 0 / #endif.  This eliminates WARNING found using checkpatch.
>
> Signed-off-by: Enrique Vargas <jevargas@seas.upenn.edu>

Acked-by: Steve Longerbeam <slongerbeam@gmail.com>

> ---
> v2 Fix description typo with broken line
> v3 Include change control, as suggested by Greg.
>
>   drivers/staging/media/imx/imx-media-csi.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> index b60ed4f22f6d..2001f7851e90 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1131,13 +1131,7 @@ static int csi_link_validate(struct v4l2_subdev *sd,
>   		 * enters the CSI's however, they are treated internally
>   		 * in the IPU as virtual channel 0.
>   		 */
> -#if 0
> -		mutex_unlock(&priv->lock);
> -		vc_num = imx_media_find_mipi_csi2_channel(&priv->sd.entity);
> -		if (vc_num < 0)
> -			return vc_num;
> -		mutex_lock(&priv->lock);
> -#endif
> +
>   		ipu_csi_set_mipi_datatype(priv->csi, vc_num,
>   					  &priv->format_mbus[CSI_SINK_PAD]);
>   	}



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

* Re: [Outreachy kernel] [PATCH v3] Staging: media: imx: eliminate unused code
  2020-03-13 17:21 [PATCH v3] Staging: media: imx: eliminate unused code Enrique Vargas
  2020-03-14  0:54 ` Steve Longerbeam
@ 2020-03-17  1:05 ` Stefano Brivio
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2020-03-17  1:05 UTC (permalink / raw)
  To: Enrique Vargas
  Cc: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	outreachy-kernel

On Fri, 13 Mar 2020 11:21:49 -0600
Enrique Vargas <jevargas@seas.upenn.edu> wrote:

> Eliminate code that is never used inside #ifdef 0 / #endif.  This eliminates WARNING found using checkpatch.

This should be wrapped to at most 76 characters, so that it can be
displayed by git (e.g. git log) without exceeding 80 columns. Some
personally prefer 72 columns or even less, I usually stick to 70.

> Signed-off-by: Enrique Vargas <jevargas@seas.upenn.edu>
> ---
> v2 Fix description typo with broken line
> v3 Include change control, as suggested by Greg.
> 
>  drivers/staging/media/imx/imx-media-csi.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> index b60ed4f22f6d..2001f7851e90 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1131,13 +1131,7 @@ static int csi_link_validate(struct v4l2_subdev *sd,
>  		 * enters the CSI's however, they are treated internally
>  		 * in the IPU as virtual channel 0.
>  		 */
> -#if 0
> -		mutex_unlock(&priv->lock);
> -		vc_num = imx_media_find_mipi_csi2_channel(&priv->sd.entity);
> -		if (vc_num < 0)
> -			return vc_num;
> -		mutex_lock(&priv->lock);
> -#endif
> +
>  		ipu_csi_set_mipi_datatype(priv->csi, vc_num,
>  					  &priv->format_mbus[CSI_SINK_PAD]);

By the way, now that you remove that, it's not clear from the comment
why vc_num is even a variable. You could directly call
ipu_csi_set_mipi_datatype() with 0 as channel (in this patch, or in
another one, I don't have a strong preference -- I would personally
do that in the same patch).

-- 
Stefano



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

end of thread, other threads:[~2020-03-17  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 17:21 [PATCH v3] Staging: media: imx: eliminate unused code Enrique Vargas
2020-03-14  0:54 ` Steve Longerbeam
2020-03-17  1:05 ` [Outreachy kernel] " Stefano Brivio

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.