diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-28 16:04:43 +0100 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2025-08-06 16:52:27 +0200 |
commit | 78b2d408fbf02bcfbf11a5aef2c0c77901854179 (patch) | |
tree | 9497c130b0c795791a4be9bfb7d6249ab81dc989 | |
parent | 4ef864f1ae332fc1ae2a8d58ac0325db677abe52 (diff) |
i2c: rcar_iic: Do not use unitialised variable
In rcar_iic_xfer if nmsgs == 0 the ret will not be assigned to. As ret
will always be 0 if the for loop is entered, may as well just return 0.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r-- | drivers/i2c/rcar_iic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/rcar_iic.c b/drivers/i2c/rcar_iic.c index e019d06be41..42d575e29ba 100644 --- a/drivers/i2c/rcar_iic.c +++ b/drivers/i2c/rcar_iic.c @@ -191,7 +191,7 @@ static int rcar_iic_xfer(struct udevice *dev, struct i2c_msg *msg, int nmsgs) return -EREMOTEIO; } - return ret; + return 0; } static int rcar_iic_set_speed(struct udevice *dev, uint speed) |