[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 30/40] lasips2: standardise on lp name for LASIPS2Port variables
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 30/40] lasips2: standardise on lp name for LASIPS2Port variables |
Date: |
Wed, 29 Jun 2022 13:40:16 +0100 |
This is shorter to type and keeps the naming convention consistent within the
LASIPS2 device.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/input/lasips2.c | 52 +++++++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index 0f392e2bee..09d909c843 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -139,28 +139,28 @@ static void lasips2_set_irq(void *opaque, int n, int
level)
static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val,
unsigned size)
{
- LASIPS2Port *port = opaque;
+ LASIPS2Port *lp = LASIPS2_PORT(opaque);
- trace_lasips2_reg_write(size, port->id, addr,
+ trace_lasips2_reg_write(size, lp->id, addr,
lasips2_write_reg_name(addr), val);
switch (addr & 0xc) {
case REG_PS2_CONTROL:
- port->control = val;
+ lp->control = val;
break;
case REG_PS2_XMTDATA:
- if (port->control & LASIPS2_CONTROL_LOOPBACK) {
- port->buf = val;
- port->loopback_rbne = true;
- qemu_set_irq(port->irq, 1);
+ if (lp->control & LASIPS2_CONTROL_LOOPBACK) {
+ lp->buf = val;
+ lp->loopback_rbne = true;
+ qemu_set_irq(lp->irq, 1);
break;
}
- if (port->id) {
- ps2_write_mouse(PS2_MOUSE_DEVICE(port->ps2dev), val);
+ if (lp->id) {
+ ps2_write_mouse(PS2_MOUSE_DEVICE(lp->ps2dev), val);
} else {
- ps2_write_keyboard(PS2_KBD_DEVICE(port->ps2dev), val);
+ ps2_write_keyboard(PS2_KBD_DEVICE(lp->ps2dev), val);
}
break;
@@ -176,53 +176,53 @@ static void lasips2_reg_write(void *opaque, hwaddr addr,
uint64_t val,
static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size)
{
- LASIPS2Port *port = opaque;
+ LASIPS2Port *lp = LASIPS2_PORT(opaque);
uint64_t ret = 0;
switch (addr & 0xc) {
case REG_PS2_ID:
- ret = port->id;
+ ret = lp->id;
break;
case REG_PS2_RCVDATA:
- if (port->control & LASIPS2_CONTROL_LOOPBACK) {
- port->loopback_rbne = false;
- qemu_set_irq(port->irq, 0);
- ret = port->buf;
+ if (lp->control & LASIPS2_CONTROL_LOOPBACK) {
+ lp->loopback_rbne = false;
+ qemu_set_irq(lp->irq, 0);
+ ret = lp->buf;
break;
}
- ret = ps2_read_data(port->ps2dev);
+ ret = ps2_read_data(lp->ps2dev);
break;
case REG_PS2_CONTROL:
- ret = port->control;
+ ret = lp->control;
break;
case REG_PS2_STATUS:
ret = LASIPS2_STATUS_DATSHD | LASIPS2_STATUS_CLKSHD;
- if (port->control & LASIPS2_CONTROL_DIAG) {
- if (!(port->control & LASIPS2_CONTROL_DATDIR)) {
+ if (lp->control & LASIPS2_CONTROL_DIAG) {
+ if (!(lp->control & LASIPS2_CONTROL_DATDIR)) {
ret &= ~LASIPS2_STATUS_DATSHD;
}
- if (!(port->control & LASIPS2_CONTROL_CLKDIR)) {
+ if (!(lp->control & LASIPS2_CONTROL_CLKDIR)) {
ret &= ~LASIPS2_STATUS_CLKSHD;
}
}
- if (port->control & LASIPS2_CONTROL_LOOPBACK) {
- if (port->loopback_rbne) {
+ if (lp->control & LASIPS2_CONTROL_LOOPBACK) {
+ if (lp->loopback_rbne) {
ret |= LASIPS2_STATUS_RBNE;
}
} else {
- if (!ps2_queue_empty(port->ps2dev)) {
+ if (!ps2_queue_empty(lp->ps2dev)) {
ret |= LASIPS2_STATUS_RBNE;
}
}
- if (port->lasips2->int_status) {
+ if (lp->lasips2->int_status) {
ret |= LASIPS2_STATUS_CMPINTR;
}
break;
@@ -233,7 +233,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr,
unsigned size)
break;
}
- trace_lasips2_reg_read(size, port->id, addr,
+ trace_lasips2_reg_read(size, lp->id, addr,
lasips2_read_reg_name(addr), ret);
return ret;
}
--
2.30.2
- [PATCH 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type, (continued)
- [PATCH 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type, Mark Cave-Ayland, 2022/06/29
- [PATCH 20/40] lasips2: move mouse port initialisation to new lasips2_mouse_port_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 21/40] lasips2: introduce lasips2_kbd_port_class_init() and lasips2_kbd_port_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 23/40] lasips2: rename LASIPS2Port irq field to birq, Mark Cave-Ayland, 2022/06/29
- [PATCH 22/40] lasips2: introduce lasips2_mouse_port_class_init() and lasips2_mouse_port_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device, Mark Cave-Ayland, 2022/06/29
- [PATCH 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ, Mark Cave-Ayland, 2022/06/29
- [PATCH 28/40] lasips2: switch to using port-based IRQs, Mark Cave-Ayland, 2022/06/29
- [PATCH 27/40] lasips2: add named input gpio to handle incoming port IRQs, Mark Cave-Ayland, 2022/06/29
- [PATCH 30/40] lasips2: standardise on lp name for LASIPS2Port variables,
Mark Cave-Ayland <=
- [PATCH 29/40] lasips2: rename LASIPS2Port parent pointer to lasips2, Mark Cave-Ayland, 2022/06/29
- [PATCH 32/40] lasips2: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 31/40] lasips2: switch register memory region to DEVICE_BIG_ENDIAN, Mark Cave-Ayland, 2022/06/29
- [PATCH 35/40] pckbd: introduce new vmstate_kbd_mmio VMStateDescription for the I8042_MMIO device, Mark Cave-Ayland, 2022/06/29
- [PATCH 33/40] lasips2: don't use legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 34/40] lasips2: update VMStateDescription for LASIPS2 device, Mark Cave-Ayland, 2022/06/29
- [PATCH 36/40] pckbd: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 37/40] ps2: remove unused legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 38/40] pckbd: don't use legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 39/40] ps2: remove unused legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/06/29