Il 22/02/2014 10:03, Alex Bligh ha scritto: > I am unfamiliar with the HPET code but symmetry suggests perhaps the 'else' > condition should be changed too: > > } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE) || > !hpet_enabled(s)) { > hpet_del_timer(timer); > } > > --
I thought the same, but there is no need for that. When the enabled bit goes from set to clear, all timers are disabled: } else if (deactivating_bit(old_val, new_val, HPET_CFG_ENABLE)) { /* Halt main counter and disable interrupt generation. */ s->hpet_counter = hpet_get_ticks(s); for (i = 0; i < s->num_timers; i++) { hpet_del_timer(&s->timer[i]); } } So hpet_del_timer would be a nop if !hpet_enabled(s). Paolo