Hello Peter, thanks a lot for comment. 02.07.2015 12:27, Peter Maydell пишет:
Thanks; this does look like a bug. This change will mean we call timer_del() even if the timer was already disabled, though, so I think it would be slightly better to rearrange the existing logic something like this:if ((old & 1) != (value & 1)) { if (value & 1) { if (tb->count == 0 && (tb->control & 2)) { tb->count = tb->load; } timerblock_reload(tb, 1); } else { timer_del(tb->timer); } } thanks -- PMM
Calling timer_del() twice is safe, but I agree that it would be better to avoid it. I'll send V2.
-- Dmitry
