diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2014-09-15 00:14:14 +0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-09-29 22:41:17 +0200 |
commit | c30d7662d81062cbc25e5ff50be8dbaca3a1f20a (patch) | |
tree | 09004fe97d82967d5b21225033b90f80326c799e /drivers/i2c/busses/i2c-rcar.c | |
parent | 4bcfda09936da647b0a3b49d5dcb3c6c6ebb0395 (diff) | |
download | talos-op-linux-c30d7662d81062cbc25e5ff50be8dbaca3a1f20a.tar.gz talos-op-linux-c30d7662d81062cbc25e5ff50be8dbaca3a1f20a.zip |
i2c: rcar: simplify check for last message
rcar_i2c_master_xfer() needlessly compares the message pointers (using indirect
addressing) in order to detect the last I2C message, while it's enough to only
compare the message indexes.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-rcar.c')
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index e506fcd3ca04..98125fb0f3fe 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -453,7 +453,7 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, priv->msg = &msgs[i]; priv->pos = 0; priv->flags = 0; - if (priv->msg == &msgs[num - 1]) + if (i == num - 1) rcar_i2c_flags_set(priv, ID_LAST_MSG); ret = rcar_i2c_prepare_msg(priv); |