Skip to contentSkip to conversation

media: imx: capture: Remove unneeded variable

PATCH In review Kimberly Brown 4 participants 4 messages Oct 19, 2018

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

PATCH 1/1 media: imx: capture: Remove unneeded variable

Remove local variable 'ret', which is used to store the return value. It is not changed during function execution. Return the variable's initial value, 0. Issue found by coccicheck.

---
 drivers/staging/media/imx/imx-media-capture.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/imx/imx-media-capture.c +1 -2
index 256039ce561e..f50f34b59694 100644
@@ -536,7 +536,6 @@ static int capture_release(struct file *file)
 	struct capture_priv *priv = video_drvdata(file);
 	struct video_device *vfd = priv->vdev.vfd;
 	struct vb2_queue *vq = &priv->q;
-	int ret = 0;
 
 	mutex_lock(&priv->mutex);
 
@@ -549,7 +548,7 @@ static int capture_release(struct file *file)
 
 	v4l2_fh_release(file);
 	mutex_unlock(&priv->mutex);
-	return ret;
+	return 0;
 }
 
 static const struct v4l2_file_operations capture_fops = {
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Kimberly Brown

Remove local variable 'ret', which is used to store the return value. It is not changed during function execution. Return the variable's initial value, 0. Issue found by coccicheck.

Quoted 35 lines
---
 drivers/staging/media/imx/imx-media-capture.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/imx/imx-media-capture.c +1 -3
index 256039ce561e..f50f34b59694 100644
@@ -536,7 +536,6 @@ static int capture_release(struct file *file)
 	struct capture_priv *priv = video_drvdata(file);
 	struct video_device *vfd = priv->vdev.vfd;
 	struct vb2_queue *vq = &priv->q;
-	int ret = 0;
 
 	mutex_lock(&priv->mutex);
 
@@ -549,7 +548,7 @@ static int capture_release(struct file *file)
 
 	v4l2_fh_release(file);
 	mutex_unlock(&priv->mutex);
-	return ret;
+	return 0;
 }
 
 static const struct v4l2_file_operations capture_fops = {
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181019014041.GA9250%40v.
For more options, visit https://groups.google.com/d/optout.

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Kimberly Brown

Hi Kimberly,

Quoted 22 lines · Kimberly Brown

Remove local variable 'ret', which is used to store the return value. It is not changed during function execution. Return the variable's initial value, 0. Issue found by coccicheck.

---
 drivers/staging/media/imx/imx-media-capture.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/imx/imx-media-capture.c +0 -1
index 256039ce561e..f50f34b59694 100644
@@ -536,7 +536,6 @@ static int capture_release(struct file *file)
 	struct capture_priv *priv = video_drvdata(file);
 	struct video_device *vfd = priv->vdev.vfd;
 	struct vb2_queue *vq = &priv->q;
-	int ret = 0;
 
 	mutex_lock(&priv->mutex);
 

drivers/staging/media/imx/imx-media-capture.c static int capture_release(struct file *file) · line 554

Quoted 8 lines
drivers/staging/media/imx/imx-media-capture.c +1 -1
@@ -549,7 +548,7 @@ static int capture_release(struct file *file)
 
 	v4l2_fh_release(file);
 	mutex_unlock(&priv->mutex);
-	return ret;
+	return 0;
 }
 
 static const struct v4l2_file_operations capture_fops = {

Thank you for the patch,

regards
Philipp

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Kimberly Brown
Quoted 30 lines · Kimberly Brown

Remove local variable 'ret', which is used to store the return value. It is not changed during function execution. Return the variable's initial value, 0. Issue found by coccicheck.

---
  drivers/staging/media/imx/imx-media-capture.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/imx/imx-media-capture.c +1 -2
index 256039ce561e..f50f34b59694 100644
@@ -536,7 +536,6 @@ static int capture_release(struct file *file)
  	struct capture_priv *priv = video_drvdata(file);
  	struct video_device *vfd = priv->vdev.vfd;
  	struct vb2_queue *vq = &priv->q;
-	int ret = 0;
 
  	mutex_lock(&priv->mutex);
 
@@ -549,7 +548,7 @@ static int capture_release(struct file *file)
 
  	v4l2_fh_release(file);
  	mutex_unlock(&priv->mutex);
-	return ret;
+	return 0;
  }
 
  static const struct v4l2_file_operations capture_fops = {