Commit 837fdcf0 authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

[media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output()

* Move the definition for the variable "ret" into an if branch
  so that an extra initialisation can be avoided at the beginning
  by this refactoring.

* Return a success code as a constant at the end.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent ca7948aa
...@@ -297,19 +297,19 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index) ...@@ -297,19 +297,19 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index)
static int vpbe_set_default_output(struct vpbe_device *vpbe_dev) static int vpbe_set_default_output(struct vpbe_device *vpbe_dev)
{ {
struct vpbe_config *cfg = vpbe_dev->cfg; struct vpbe_config *cfg = vpbe_dev->cfg;
int ret = 0;
int i; int i;
for (i = 0; i < cfg->num_outputs; i++) { for (i = 0; i < cfg->num_outputs; i++) {
if (!strcmp(def_output, if (!strcmp(def_output,
cfg->outputs[i].output.name)) { cfg->outputs[i].output.name)) {
ret = vpbe_set_output(vpbe_dev, i); int ret = vpbe_set_output(vpbe_dev, i);
if (!ret) if (!ret)
vpbe_dev->current_out_index = i; vpbe_dev->current_out_index = i;
return ret; return ret;
} }
} }
return ret; return 0;
} }
/** /**
......
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