Message ID | 20180324192455.12254-4-mdavidsaver@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 24 March 2018 at 19:24, Michael Davidsaver <mdavidsaver@gmail.com> wrote: > Need to save HOUR[HOUR12] bit to keep > track of guest selection of 12-hour mode. > Write through current time registers to > achieve this. Will be overwritten > by the next read/latch. > > Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com> > --- > hw/timer/ds1338.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/hw/timer/ds1338.c b/hw/timer/ds1338.c > index b5630e214a..72a4692d60 100644 > --- a/hw/timer/ds1338.c > +++ b/hw/timer/ds1338.c > @@ -224,10 +224,8 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data) > value unchanged. */ > data = (data & ~CTRL_OSF) | (data & s->nvram[s->ptr] & CTRL_OSF); > > - s->nvram[s->ptr] = data; > - } else { > - s->nvram[s->ptr] = data; > } > + s->nvram[s->ptr] = data; > inc_regptr(s); > return 0; The code change here looks like a reasonable no-behaviour-change simplification of the code, but it doesn't match up with the description in the commit message ? thanks -- PMM
diff --git a/hw/timer/ds1338.c b/hw/timer/ds1338.c index b5630e214a..72a4692d60 100644 --- a/hw/timer/ds1338.c +++ b/hw/timer/ds1338.c @@ -224,10 +224,8 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data) value unchanged. */ data = (data & ~CTRL_OSF) | (data & s->nvram[s->ptr] & CTRL_OSF); - s->nvram[s->ptr] = data; - } else { - s->nvram[s->ptr] = data; } + s->nvram[s->ptr] = data; inc_regptr(s); return 0; }
Need to save HOUR[HOUR12] bit to keep track of guest selection of 12-hour mode. Write through current time registers to achieve this. Will be overwritten by the next read/latch. Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com> --- hw/timer/ds1338.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)