Skip to contentSkip to conversation

davinci: remove an unneeded check

PATCH In review Dan Carpenter 2 participants 2 messages Sep 22, 2014 – Sep 23, 2014

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

PATCH 1/1 davinci: remove an unneeded check

We don't need to check "ret", we know it's zero.

drivers/media/platform/davinci/vpfe_capture.c +4 -5
index c557eb5..3eb6e4b 100644
@@ -442,11 +442,10 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
 		return ret;
 
 	/* Update the values of sizeimage and bytesperline */
-	if (!ret) {
-		pix->bytesperline = ccdc_dev->hw_ops.get_line_length();
-		pix->sizeimage = pix->bytesperline * pix->height;
-	}
-	return ret;
+	pix->bytesperline = ccdc_dev->hw_ops.get_line_length();
+	pix->sizeimage = pix->bytesperline * pix->height;
+
+	return 0;
 }
 
 static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)
Acked-by on v1 1/1
#1 lore raw

Hi Dan,

Thanks for the patch!

Quoted 3 lines · Dan Carpenter

We don't need to check "ret", we know it's zero.

Regards,
--Prabhakar Lad

Quoted 21 lines
drivers/media/platform/davinci/vpfe_capture.c +4 -5
index c557eb5..3eb6e4b 100644
@@ -442,11 +442,10 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
                return ret;
 
        /* Update the values of sizeimage and bytesperline */
-       if (!ret) {
-               pix->bytesperline = ccdc_dev->hw_ops.get_line_length();
-               pix->sizeimage = pix->bytesperline * pix->height;
-       }
-       return ret;
+       pix->bytesperline = ccdc_dev->hw_ops.get_line_length();
+       pix->sizeimage = pix->bytesperline * pix->height;
+
+       return 0;
 }
 
 static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)