Commit 3ea1cb24 authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman

staging: bcm2835-camera: reduce indentation in ctrl_set_image_effect

We can reduce the indentation in the loop by using continue in case the
effect doesn't match.
Reviewed-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1585485901-10172-10-git-send-email-stefan.wahren@i2se.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a60f0c8b
......@@ -514,7 +514,9 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
struct mmal_parameter_imagefx_parameters imagefx;
for (i = 0; i < ARRAY_SIZE(v4l2_to_mmal_effects_values); i++) {
if (ctrl->val == v4l2_to_mmal_effects_values[i].v4l2_effect) {
if (ctrl->val != v4l2_to_mmal_effects_values[i].v4l2_effect)
continue;
imagefx.effect =
v4l2_to_mmal_effects_values[i].mmal_effect;
imagefx.num_effect_params =
......@@ -530,10 +532,8 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
dev->colourfx.enable =
v4l2_to_mmal_effects_values[i].col_fx_enable;
if (!v4l2_to_mmal_effects_values[i].col_fx_fixed_cbcr) {
dev->colourfx.u =
v4l2_to_mmal_effects_values[i].u;
dev->colourfx.v =
v4l2_to_mmal_effects_values[i].v;
dev->colourfx.u = v4l2_to_mmal_effects_values[i].u;
dev->colourfx.v = v4l2_to_mmal_effects_values[i].v;
}
control = &dev->component[COMP_CAMERA]->control;
......@@ -550,7 +550,6 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
MMAL_PARAMETER_COLOUR_EFFECT,
&dev->colourfx, sizeof(dev->colourfx));
}
}
exit:
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment