staging: atomisp: clean up return logic, remove redunant code
authorColin Ian King <colin.king@canonical.com>
Sat, 11 Mar 2017 19:32:05 +0000 (19:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 13:57:00 +0000 (14:57 +0100)
There is no need to check if ret is non-zero, remove this
redundant check and just return the error status from the call
to mt9m114_write_reg_array.

Detected by CoverityScan, CID#1416577 ("Identical code for
different branches")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/i2c/mt9m114.c

index 1b79cdb27ce69be2493744ff870d5a35eb0fe86d..f9a00228765f1f534b2df12204b4311f693cf6e8 100644 (file)
@@ -444,12 +444,8 @@ static int mt9m114_set_suspend(struct v4l2_subdev *sd)
 static int mt9m114_init_common(struct v4l2_subdev *sd)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
-       int ret;
 
-       ret = mt9m114_write_reg_array(client, mt9m114_common, PRE_POLLING);
-       if (ret)
-               return ret;
-       return ret;
+       return mt9m114_write_reg_array(client, mt9m114_common, PRE_POLLING);
 }
 
 static int power_ctrl(struct v4l2_subdev *sd, bool flag)