Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
peripheral-register.c: no tmp optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Feb 10, 2019
1 parent 572a0c8 commit ee07085
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hw/cortexm/peripheral-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee07085

Please sign in to comment.