[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 for-2.7 10/20] hw/char: QOM'ify sclpconsole-lm.c
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH v2 for-2.7 10/20] hw/char: QOM'ify sclpconsole-lm.c |
Date: |
Wed, 11 May 2016 16:58:02 +0200 |
From: xiaoqiang zhao <address@hidden>
Drop the DO_UPCAST macro
Signed-off-by: xiaoqiang zhao <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/char/sclpconsole-lm.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 7d4ff81..a22ad8d 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -44,6 +44,10 @@ typedef struct SCLPConsoleLM {
uint8_t buf[SIZE_CONSOLE_BUFFER];
} SCLPConsoleLM;
+#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
+#define SCLPLM_CONSOLE(obj) \
+ OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
+
/*
* Character layer call-back functions
*
@@ -116,7 +120,7 @@ static int get_console_data(SCLPEvent *event, uint8_t *buf,
size_t *size,
{
int len;
- SCLPConsoleLM *cons = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *cons = SCLPLM_CONSOLE(event);
len = cons->length;
/* data need to fit into provided SCLP buffer */
@@ -190,7 +194,7 @@ static int write_console_data(SCLPEvent *event, const
uint8_t *buf, int len)
int ret = 0;
const uint8_t *buf_offset;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
if (!scon->chr) {
/* If there's no backend, we can just say we consumed all data. */
@@ -244,7 +248,7 @@ static int write_event_data(SCLPEvent *event,
EventBufferHeader *ebh)
int errors = 0;
MDBO *mdbo;
SclpMsg *data = (SclpMsg *) ebh;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
len = be16_to_cpu(data->mdb.header.length);
if (len < sizeof(data->mdb.header)) {
@@ -313,7 +317,7 @@ static int console_init(SCLPEvent *event)
{
static bool console_available;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
if (console_available) {
error_report("Multiple line-mode operator consoles are not supported");
@@ -336,7 +340,7 @@ static int console_exit(SCLPEvent *event)
static void console_reset(DeviceState *dev)
{
SCLPEvent *event = SCLP_EVENT(dev);
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
event->event_pending = false;
scon->length = 0;
--
2.6.6
- [Qemu-devel] [PATCH v2 for-2.7 04/20] s390x/ipl: Add type and length checks for IplParameterBlock values, (continued)
- [Qemu-devel] [PATCH v2 for-2.7 04/20] s390x/ipl: Add type and length checks for IplParameterBlock values, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 16/20] s390x/pci: introduce S390PCIBusDevice.iommu_enabled, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 13/20] s390x/pci: separate s390_sclp_configure function, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 15/20] s390x/pci: export pci_dereg_ioat and pci_dereg_irqs, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 03/20] s390x/ipl: Extend the IplParameterBlock struct, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 06/20] s390x/ipl: Add ssid field to IplParameterBlock, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 11/20] hw/char: QOM'ify sclpconsole.c, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 20/20] s390x/pci: remove whitespace, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 17/20] s390x/pci: fix s390_pci_sclp_deconfigure, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 14/20] s390x/pci: separate s390_pcihost_iommu_configure function, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 10/20] hw/char: QOM'ify sclpconsole-lm.c,
Cornelia Huck <=
- [Qemu-devel] [PATCH v2 for-2.7 08/20] s390-ccw.img: rebuild image, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 09/20] s390x/ipl: Remove redundant usage of gr7, Cornelia Huck, 2016/05/11
- [Qemu-devel] [PATCH v2 for-2.7 19/20] s390x/pci: add length checking for pci sclp handlers, Cornelia Huck, 2016/05/11
- Re: [Qemu-devel] [PATCH v2 for-2.7 00/20] First batch of s390x patches, Christian Borntraeger, 2016/05/12