From ee07085299a4ec1edc92453eef9b3c3bd0c4ab92 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Sun, 10 Feb 2019 12:37:02 +0200 Subject: [PATCH] peripheral-register.c: no tmp optimization --- hw/cortexm/peripheral-register.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/cortexm/peripheral-register.c b/hw/cortexm/peripheral-register.c index d38a66cee8..883c183a4b 100644 --- a/hw/cortexm/peripheral-register.c +++ b/hw/cortexm/peripheral-register.c @@ -573,14 +573,13 @@ static void peripheral_register_write_callback(Object *reg, Object *periph, state->prev_value = state->value; - peripheral_register_t tmp_value; if (state->pre_write) { - tmp_value = state->pre_write(reg, periph, addr, offset, size, value, + state->value = state->pre_write(reg, periph, addr, offset, size, value, full_value); } else { - tmp_value = full_value; + state->value = full_value; } - state->value = tmp_value & state->persistent_bits; + state->value &= state->persistent_bits; // Actions associated with registers are implemented with post write // callbacks. The original value, possibly short and unaligned, is