i2c: clarify our usage of the result of the assignment v0.2.0
authorBrendan Le Foll <brendan.le.foll@intel.com>
Sun, 27 Apr 2014 22:15:54 +0000 (23:15 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Sun, 27 Apr 2014 22:15:54 +0000 (23:15 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/i2c/i2c.c

index db32484..10d2d92 100644 (file)
@@ -67,7 +67,8 @@ int
 maa_i2c_read_byte(i2c_t* dev)
 {
     int byte;
-    if (byte = i2c_smbus_read_byte(dev->fh) < 0) {
+    byte = i2c_smbus_read_byte(dev->fh);
+    if (byte < 0) {
         return -1;
     }
     return byte;