Patchwork [v6,03/12] acpi: don't pass overflow_time to acpi_pm1_evt_get_sts

login
register
mail settings
Submitter Gerd Hoffmann
Date Feb. 23, 2012, 12:45 p.m.
Message ID <1330001126-20564-4-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/142622/
State New
Headers show

Comments

Gerd Hoffmann - Feb. 23, 2012, 12:45 p.m.
Pretty pointless, can easily be reached via ACPIREGS now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi.c       |    6 +++---
 hw/acpi.h       |    2 +-
 hw/acpi_piix4.c |    4 ++--
 hw/vt82c686.c   |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

Patch

diff --git a/hw/acpi.c b/hw/acpi.c
index 1922e53..1129335 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -249,10 +249,10 @@  int acpi_table_add(const char *t)
 }
 
 /* ACPI PM1a EVT */
-uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time)
+uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar)
 {
     int64_t d = acpi_pm_tmr_get_clock();
-    if (d >= overflow_time) {
+    if (d >= ar->tmr.overflow_time) {
         ar->pm1.evt.sts |= ACPI_BITMASK_TIMER_STATUS;
     }
     return ar->pm1.evt.sts;
@@ -260,7 +260,7 @@  uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time)
 
 void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val)
 {
-    uint16_t pm1_sts = acpi_pm1_evt_get_sts(ar, ar->tmr.overflow_time);
+    uint16_t pm1_sts = acpi_pm1_evt_get_sts(ar);
     if (pm1_sts & val & ACPI_BITMASK_TIMER_STATUS) {
         /* if TMRSTS is reset, then compute the new overflow time */
         acpi_pm_tmr_calc_overflow_time(ar);
diff --git a/hw/acpi.h b/hw/acpi.h
index 530c86a..e1d5e3b 100644
--- a/hw/acpi.h
+++ b/hw/acpi.h
@@ -131,7 +131,7 @@  static inline int64_t acpi_pm_tmr_get_clock(void)
 }
 
 /* PM1a_EVT: piix and ich9 don't implement PM1b. */
-uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time);
+uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar);
 void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val);
 void acpi_pm1_evt_power_down(ACPIREGS *ar);
 void acpi_pm1_evt_reset(ACPIREGS *ar);
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 68d5eab..5b16d20 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -80,7 +80,7 @@  static void pm_update_sci(PIIX4PMState *s)
 {
     int sci_level, pmsts;
 
-    pmsts = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time);
+    pmsts = acpi_pm1_evt_get_sts(&s->ar);
     sci_level = (((pmsts & s->ar.pm1.evt.en) &
                   (ACPI_BITMASK_RT_CLOCK_ENABLE |
                    ACPI_BITMASK_POWER_BUTTON_ENABLE |
@@ -138,7 +138,7 @@  static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
 
     switch(addr) {
     case 0x00:
-        val = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time);
+        val = acpi_pm1_evt_get_sts(&s->ar);
         break;
     case 0x02:
         val = s->ar.pm1.evt.en;
diff --git a/hw/vt82c686.c b/hw/vt82c686.c
index c659283..1b083de 100644
--- a/hw/vt82c686.c
+++ b/hw/vt82c686.c
@@ -177,7 +177,7 @@  static void pm_update_sci(VT686PMState *s)
 {
     int sci_level, pmsts;
 
-    pmsts = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time);
+    pmsts = acpi_pm1_evt_get_sts(&s->ar);
     sci_level = (((pmsts & s->ar.pm1.evt.en) &
                   (ACPI_BITMASK_RT_CLOCK_ENABLE |
                    ACPI_BITMASK_POWER_BUTTON_ENABLE |
@@ -226,7 +226,7 @@  static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
     addr &= 0x0f;
     switch (addr) {
     case 0x00:
-        val = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time);
+        val = acpi_pm1_evt_get_sts(&s->ar);
         break;
     case 0x02:
         val = s->ar.pm1.evt.en;