aux: fix break that wanted to break two levels out
commit5229f45bd98558af84d806a98032df3cb741c357
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Jul 2016 12:47:00 +0000 (7 13:47 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 7 Jul 2016 12:47:00 +0000 (7 13:47 +0100)
treefbdcea867a0930926831f3cc2ecdc0755fcd15f8
parentbb14a1eda0d060413d17466c58b39e4c0dbcde4e
aux: fix break that wanted to break two levels out

The last "ret = AUX_I2C_NACK;" is dead, because it is always overridden
by AUX_I2C_ACK.  What really the code wants is to jump out of the switch
statement, and a "return" will not cut it because it would omit a debug
printf.

Change the logic so that we can break out of the while loop.  For clarity,
hoist the bus->last_* assignments up, right after i2c_start_transfer.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/aux.c