From 1ba2d6040ce0ef7516dac12b8edfcd95b2751519 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Sun, 27 Apr 2014 23:15:54 +0100 Subject: [PATCH] i2c: clarify our usage of the result of the assignment Signed-off-by: Brendan Le Foll --- src/i2c/i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i2c/i2c.c b/src/i2c/i2c.c index db32484..10d2d92 100644 --- a/src/i2c/i2c.c +++ b/src/i2c/i2c.c @@ -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;