Patchwork [01/10] RTC: Remove the logic to update time format when DM bit changed

login
register
mail settings
Submitter Paolo Bonzini
Date Aug. 1, 2012, 4:41 p.m.
Message ID <1343839312-24030-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/174527/
State New
Headers show

Comments

Paolo Bonzini - Aug. 1, 2012, 4:41 p.m.
From: Yang Zhang <yang.z.zhang@intel.com>

Changing the DM (binary/BCD) and 24/12 control bit doesn't affect the internal
registers. It only indicates what format is used for those registers.

Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/mc146818rtc.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Patch

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 3777f85..6e5b2f0 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -220,15 +220,7 @@  static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
                     rtc_set_time(s);
                 }
             }
-            if (((s->cmos_data[RTC_REG_B] ^ data) & (REG_B_DM | REG_B_24H)) &&
-                !(data & REG_B_SET)) {
-                /* If the time format has changed and not in set mode,
-                   update the registers immediately. */
-                s->cmos_data[RTC_REG_B] = data;
-                rtc_copy_date(s);
-            } else {
-                s->cmos_data[RTC_REG_B] = data;
-            }
+            s->cmos_data[RTC_REG_B] = data;
             rtc_timer_update(s, qemu_get_clock_ns(rtc_clock));
             break;
         case RTC_REG_C: