i2c: rcar_iic: Do not use unitialised variable
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 28 Jul 2025 15:04:43 +0000 (16:04 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Wed, 6 Aug 2025 14:52:27 +0000 (16:52 +0200)
commit78b2d408fbf02bcfbf11a5aef2c0c77901854179
tree9497c130b0c795791a4be9bfb7d6249ab81dc989
parent4ef864f1ae332fc1ae2a8d58ac0325db677abe52
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>
drivers/i2c/rcar_iic.c