mc146818rtc: update periodic timer only if it is needed
commit9a6e2dcfdda31275296c2a55ae10ec9ee5265459
authorXiao Guangrong <xiaoguangrong@tencent.com>
Wed, 10 May 2017 08:32:55 +0000 (10 16:32 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Jun 2017 18:18:35 +0000 (6 20:18 +0200)
treed397199d316c53e0647a554736a152961929709f
parent65dfad62a176f5265f801683be64149c5ad55f7d
mc146818rtc: update periodic timer only if it is needed

Currently, the timer is updated whenever RegA or RegB is written
even if the periodic timer related configuration is not changed

This patch optimizes it slightly to make the update happen only
if its period or enable-status is changed, also later patches are
depend on this optimization

Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Message-Id: <20170510083259.3900-2-xiaoguangrong@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/timer/mc146818rtc.c