Skip to contentSkip to conversation

Staging: vc04_services: Cleanup in ctrl_set_bitrate()

PATCH In review Madhumitha Prabakaran 2 participants 2 messages Apr 23, 2019 – Apr 27, 2019

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

PATCH v3 1/1 Staging: vc04_services: Cleanup in ctrl_set_bitrate()

Remove unnecessary variable from the function and make a corresponding change w.r.t the variable. In addition to that align the parameters in the parentheses to maintain Linux kernel coding style

Issue suggested by Coccinelle.

---
Changes in v2 -
1) Fix my own error of removing function call from the variable.
2) Align the function parameters with parentheses.

Changes in v3 -
1) Since there was no real purpose of returning true value, replace it with return value of the function vchiq_mmal_port_parameter_set().

---
 drivers/staging/vc04_services/bcm2835-camera/controls.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/controls.c +3 -6
index e39ab5fae724..2e0a422cdf3e 100644
@@ -607,18 +607,15 @@ static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev,
 			    struct v4l2_ctrl *ctrl,
 			    const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl)
 {
-	int ret;
 	struct vchiq_mmal_port *encoder_out;
 
 	dev->capture.encode_bitrate = ctrl->val;
 
 	encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
 
-	ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
-					    mmal_ctrl->mmal_id,
-					    &ctrl->val, sizeof(ctrl->val));
-	ret = 0;
-	return ret;
+	return vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
+					     mmal_ctrl->mmal_id, &ctrl->val,
+					     sizeof(ctrl->val));
 }
 
 static int ctrl_set_bitrate_mode(struct bm2835_mmal_dev *dev,
Signature · 1 line
2.17.1