]> git.proxmox.com Git - mirror_qemu.git/commitdiff
mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386
authorXiao Guangrong <xiaoguangrong@tencent.com>
Wed, 10 May 2017 08:32:57 +0000 (16:32 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Jun 2017 18:18:35 +0000 (20:18 +0200)
Any tick policy specified on other platforms rather on TARGET_I386
will fall back to LOST_TICK_POLICY_DISCARD silently, this patch makes
sure only TARGET_I386 can enable LOST_TICK_POLICY_SLEW

After that, we can enable LOST_TICK_POLICY_SLEW in the common code
which need not use '#ifdef TARGET_I386' to make these code be x86
specific anymore

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

index aeb60cc3e3f5fc392a9524e3d067f8ef9b2d94d6..4870a72015be2941d0a04e994e9f577cf3d77477 100644 (file)
@@ -974,19 +974,19 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
 
     rtc_set_date_from_host(isadev);
 
-#ifdef TARGET_I386
     switch (s->lost_tick_policy) {
+#ifdef TARGET_I386
     case LOST_TICK_POLICY_SLEW:
         s->coalesced_timer =
             timer_new_ns(rtc_clock, rtc_coalesced_timer, s);
         break;
+#endif
     case LOST_TICK_POLICY_DISCARD:
         break;
     default:
         error_setg(errp, "Invalid lost tick policy.");
         return;
     }
-#endif
 
     s->periodic_timer = timer_new_ns(rtc_clock, rtc_periodic_timer, s);
     s->update_timer = timer_new_ns(rtc_clock, rtc_update_timer, s);