]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 12 Oct 2016 09:22:23 +0000 (06:22 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 16 Nov 2016 14:55:50 +0000 (12:55 -0200)
Move assignments for two local variables into an else branch so that
their setting will only be performed after corresponding data processing
succeeded by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/davinci/vpfe_capture.c

index ca044bf1c05c903c6c457a259cdcd0527305aa08..86509d2f274a0824b398207c042138ccd1fa3de2 100644 (file)
@@ -1109,7 +1109,7 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index)
        struct vpfe_subdev_info *sdinfo;
        int subdev_index, inp_index;
        struct vpfe_route *route;
-       u32 input = 0, output = 0;
+       u32 input, output;
        int ret;
 
        v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_s_input\n");
@@ -1142,6 +1142,9 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index)
        if (route && sdinfo->can_route) {
                input = route->input;
                output = route->output;
+       } else {
+               input = 0;
+               output = 0;
        }
 
        if (sd)