Patchwork [v6,1/7] RTC: Remove the logic to update time format when DM bit changed

login
register
mail settings
Submitter Zhang, Yang Z
Date May 17, 2012, 2:28 a.m.
Message ID <A9667DDFB95DB7438FA9D7D576C3D87E13A7E4@SHSMSX101.ccr.corp.intel.com>
Download mbox | patch
Permalink /patch/159799/
State New
Headers show

Comments

Zhang, Yang Z - May 17, 2012, 2:28 a.m.
Change DM(date mode) and 24/12 control bit doesn't affect the internal
registers. It only indicates what format is using for those registers.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
---
 hw/mc146818rtc.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

--
1.7.1

Patch

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 9c64e0a..1ccfb50 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: