Skip to contentSkip to conversation

Staging: media: imx: eliminate unused code

PATCH In review Enrique Vargas 3 participants 3 messages Mar 13, 2020 – Mar 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Staging: media: imx: eliminate unused code

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

---
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(-)
drivers/staging/media/imx/imx-media-csi.c +1 -7
index b60ed4f22f6d..2001f7851e90 100644
@@ -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]);
 	}
Signature · 1 line
2.17.1
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 3 lines · Enrique Vargas

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

Quoted 26 lines

---
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(-)
drivers/staging/media/imx/imx-media-csi.c +1 -7
index b60ed4f22f6d..2001f7851e90 100644
@@ -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 lore raw
In reply to Enrique Vargas
Quoted 1 line · On Fri, 13 Mar 2020 11:21:49 -0600 Enrique Vargas <[email protected]>…

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.

Quoted 16 lines

---
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(-)
drivers/staging/media/imx/imx-media-csi.c +0 -0
index b60ed4f22f6d..2001f7851e90 100644
@@ -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.
 		 */

drivers/staging/media/imx/imx-media-csi.c static int csi_link_validate(struct v4l2_subdev *sd, · line 1136

Quoted 10 lines
drivers/staging/media/imx/imx-media-csi.c +1 -7
-#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).

Signature · 1 line
Stefano