Comment 7 for bug 1734474

Revision history for this message
Peter Maydell (pmaydell) wrote :

This change on current head-of-git, which is effectively just reverting the logic-change part of commit cb5ef3fa1871522a08, is sufficient to allow the n800 image to boot again.
But that commit was trying to fix a bug, so we probably need to look more carefully at the logic rather than just reverting it...

diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index b47120492a..1813477268 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -161,14 +161,12 @@ static int tmp105_tx(I2CSlave *i2c, uint8_t data)
 {
     TMP105State *s = TMP105(i2c);

- if (s->len == 0) {
+ if (!s->len++) {
         s->pointer = data;
- s->len++;
     } else {
         if (s->len <= 2) {
             s->buf[s->len - 1] = data;
         }
- s->len++;
         tmp105_write(s);
     }