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,42 +514,41 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev, ...@@ -514,42 +514,41 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
struct mmal_parameter_imagefx_parameters imagefx; struct mmal_parameter_imagefx_parameters imagefx;
for (i = 0; i < ARRAY_SIZE(v4l2_to_mmal_effects_values); i++) { 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)
imagefx.effect = continue;
v4l2_to_mmal_effects_values[i].mmal_effect;
imagefx.num_effect_params = imagefx.effect =
v4l2_to_mmal_effects_values[i].num_effect_params; v4l2_to_mmal_effects_values[i].mmal_effect;
imagefx.num_effect_params =
if (imagefx.num_effect_params > MMAL_MAX_IMAGEFX_PARAMETERS) v4l2_to_mmal_effects_values[i].num_effect_params;
imagefx.num_effect_params = MMAL_MAX_IMAGEFX_PARAMETERS;
for (j = 0; j < imagefx.num_effect_params; j++)
imagefx.effect_parameter[j] =
v4l2_to_mmal_effects_values[i].effect_params[j];
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;
}
control = &dev->component[COMP_CAMERA]->control; if (imagefx.num_effect_params > MMAL_MAX_IMAGEFX_PARAMETERS)
imagefx.num_effect_params = MMAL_MAX_IMAGEFX_PARAMETERS;
ret = vchiq_mmal_port_parameter_set( for (j = 0; j < imagefx.num_effect_params; j++)
dev->instance, control, imagefx.effect_parameter[j] =
MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, v4l2_to_mmal_effects_values[i].effect_params[j];
&imagefx, sizeof(imagefx));
if (ret)
goto exit;
ret = vchiq_mmal_port_parameter_set( dev->colourfx.enable =
dev->instance, control, v4l2_to_mmal_effects_values[i].col_fx_enable;
MMAL_PARAMETER_COLOUR_EFFECT, if (!v4l2_to_mmal_effects_values[i].col_fx_fixed_cbcr) {
&dev->colourfx, sizeof(dev->colourfx)); 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;
ret = vchiq_mmal_port_parameter_set(
dev->instance, control,
MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS,
&imagefx, sizeof(imagefx));
if (ret)
goto exit;
ret = vchiq_mmal_port_parameter_set(
dev->instance, control,
MMAL_PARAMETER_COLOUR_EFFECT,
&dev->colourfx, sizeof(dev->colourfx));
} }
exit: exit:
......
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