[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/22] pmu: fix duplicate autopoll mask variable
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 04/22] pmu: fix duplicate autopoll mask variable |
Date: |
Sun, 14 Jun 2020 15:28:22 +0100 |
It seems that during the initial work to introduce the via-pmu ADB support a
duplicate autopoll mask variable was accidentally left in place.
Remove the duplicate autopoll_mask variable and switch everything over to
use adb_poll_mask instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/macio/pmu.c | 15 +++++++--------
include/hw/misc/macio/pmu.h | 1 -
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
index 9a9cd427e1..3af4ef1a04 100644
--- a/hw/misc/macio/pmu.c
+++ b/hw/misc/macio/pmu.c
@@ -173,11 +173,11 @@ static void pmu_cmd_set_adb_autopoll(PMUState *s,
uint16_t mask)
{
trace_pmu_cmd_set_adb_autopoll(mask);
- if (s->autopoll_mask == mask) {
+ if (s->adb_poll_mask == mask) {
return;
}
- s->autopoll_mask = mask;
+ s->adb_poll_mask = mask;
if (mask) {
timer_mod(s->adb_poll_timer,
qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 30);
@@ -272,9 +272,9 @@ static void pmu_cmd_adb_poll_off(PMUState *s,
return;
}
- if (s->has_adb && s->autopoll_mask) {
+ if (s->has_adb && s->adb_poll_mask) {
timer_del(s->adb_poll_timer);
- s->autopoll_mask = false;
+ s->adb_poll_mask = 0;
}
}
@@ -696,8 +696,8 @@ static const VMStateDescription vmstate_pmu_adb = {
static const VMStateDescription vmstate_pmu = {
.name = "pmu",
- .version_id = 0,
- .minimum_version_id = 0,
+ .version_id = 1,
+ .minimum_version_id = 1,
.fields = (VMStateField[]) {
VMSTATE_STRUCT(mos6522_pmu.parent_obj, PMUState, 0, vmstate_mos6522,
MOS6522State),
@@ -713,7 +713,6 @@ static const VMStateDescription vmstate_pmu = {
VMSTATE_UINT8(intbits, PMUState),
VMSTATE_UINT8(intmask, PMUState),
VMSTATE_UINT8(autopoll_rate_ms, PMUState),
- VMSTATE_UINT8(autopoll_mask, PMUState),
VMSTATE_UINT32(tick_offset, PMUState),
VMSTATE_TIMER_PTR(one_sec_timer, PMUState),
VMSTATE_INT64(one_sec_target, PMUState),
@@ -733,7 +732,7 @@ static void pmu_reset(DeviceState *dev)
s->intbits = 0;
s->cmd_state = pmu_state_idle;
- s->autopoll_mask = 0;
+ s->adb_poll_mask = 0;
}
static void pmu_realize(DeviceState *dev, Error **errp)
diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h
index 7ef83dee4c..4f34b6f9e7 100644
--- a/include/hw/misc/macio/pmu.h
+++ b/include/hw/misc/macio/pmu.h
@@ -220,7 +220,6 @@ typedef struct PMUState {
ADBBusState adb_bus;
uint16_t adb_poll_mask;
uint8_t autopoll_rate_ms;
- uint8_t autopoll_mask;
QEMUTimer *adb_poll_timer;
uint8_t adb_reply_size;
uint8_t adb_reply[ADB_MAX_OUT_LEN];
--
2.20.1
- [PATCH 00/22] ADB: fix autopoll issues and rework mac_via state machine, Mark Cave-Ayland, 2020/06/14
- [PATCH 01/22] adb: coding style update to fix checkpatch errors, Mark Cave-Ayland, 2020/06/14
- [PATCH 02/22] adb: fix adb-mouse read length and revert disable-reg3-direct-writes workaround, Mark Cave-Ayland, 2020/06/14
- [PATCH 03/22] cuda: convert ADB autopoll timer from ns to ms, Mark Cave-Ayland, 2020/06/14
- [PATCH 04/22] pmu: fix duplicate autopoll mask variable,
Mark Cave-Ayland <=
- [PATCH 05/22] pmu: honour autopoll_rate_ms when rearming the ADB autopoll timer, Mark Cave-Ayland, 2020/06/14
- [PATCH 06/22] adb: introduce realize/unrealize and VMStateDescription for ADB bus, Mark Cave-Ayland, 2020/06/14
- [PATCH 07/22] adb: create autopoll variables directly within ADBBusState, Mark Cave-Ayland, 2020/06/14
- [PATCH 08/22] cuda: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 09/22] pmu: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 10/22] mac_via: convert to use ADBBusState internal autopoll variables, Mark Cave-Ayland, 2020/06/14
- [PATCH 11/22] adb: introduce new ADBDeviceHasData method to ADBDeviceClass, Mark Cave-Ayland, 2020/06/14
- [PATCH 12/22] adb: keep track of devices with pending data, Mark Cave-Ayland, 2020/06/14
- [PATCH 13/22] adb: add status field for holding information about the last ADB request, Mark Cave-Ayland, 2020/06/14