meson: i2c: fix coverity warning
authorYingyuan Zhu <yingyuan.zhu@amlogic.com>
Wed, 29 Aug 2018 05:48:27 +0000 (13:48 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 6 Sep 2018 14:02:18 +0000 (07:02 -0700)
PD#172722: meson: i2c: fix coverity warning

Here,the value of "ret" must be equal to 0,
so that the program cannot execute to the left of
the expression "return ret ?: size;".
This causes "Logically dead code".

Change-Id: Ief0cdb891e5583f0fba1ff166b40a5e71b67342f
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
drivers/amlogic/i2c/i2c-meson-master.c

index 85a6b3d2c8bead1e15311dc3602b0ed29f850dcf..26c4d6e0bf80bfd129888c8e08da41d33bff28cd 100644 (file)
@@ -525,7 +525,7 @@ static ssize_t meson_i2c_speed_store(struct device *child,
                return ret;
        i2c->frequency = val;
 
-       return ret ? : size;
+       return size;
 }
 
 static DEVICE_ATTR(speed, 0644, meson_i2c_speed_show,