qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: borntraeger@de.ibm.com, agraf@suse.de, jfrei@linux.vnet.ibm.com,
	qemu-devel@nongnu.org, xiaoqiang zhao <zxq_yx_007@163.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL 11/20] hw/char: QOM'ify sclpconsole.c
Date: Tue, 17 May 2016 16:46:08 +0200	[thread overview]
Message-ID: <1463496377-9729-12-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1463496377-9729-1-git-send-email-cornelia.huck@de.ibm.com>

From: xiaoqiang zhao <zxq_yx_007@163.com>

Drop the DO_UPCAST macro

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Message-Id: <1459237645-17227-7-git-send-email-zxq_yx_007@163.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/char/sclpconsole.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 45997ff..15a5b2b 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -40,6 +40,10 @@ typedef struct SCLPConsole {
     bool notify;            /* qemu_notify_event() req'd if true           */
 } SCLPConsole;
 
+#define TYPE_SCLP_CONSOLE "sclpconsole"
+#define SCLP_CONSOLE(obj) \
+    OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
+
 /* character layer call-back functions */
 
 /* Return number of bytes that fit into iov buffer */
@@ -95,7 +99,7 @@ static unsigned int receive_mask(void)
 static void get_console_data(SCLPEvent *event, uint8_t *buf, size_t *size,
                              int avail)
 {
-    SCLPConsole *cons = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *cons = SCLP_CONSOLE(event);
 
     /* first byte is hex 0 saying an ascii string follows */
     *buf++ = '\0';
@@ -157,7 +161,7 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr,
 static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf,
                                   size_t len)
 {
-    SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *scon = SCLP_CONSOLE(event);
 
     if (!scon->chr) {
         /* If there's no backend, we can just say we consumed all data. */
@@ -214,7 +218,7 @@ static int console_init(SCLPEvent *event)
 {
     static bool console_available;
 
-    SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *scon = SCLP_CONSOLE(event);
 
     if (console_available) {
         error_report("Multiple VT220 operator consoles are not supported");
@@ -232,7 +236,7 @@ static int console_init(SCLPEvent *event)
 static void console_reset(DeviceState *dev)
 {
    SCLPEvent *event = SCLP_EVENT(dev);
-   SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+   SCLPConsole *scon = SCLP_CONSOLE(event);
 
    event->event_pending = false;
    scon->iov_sclp = 0;
-- 
2.8.2

  parent reply	other threads:[~2016-05-17 14:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 14:45 [Qemu-devel] [PULL 00/20] First round of s390x patches for 2.7 Cornelia Huck
2016-05-17 14:45 ` [Qemu-devel] [PULL 01/20] s390x: add compat machine " Cornelia Huck
2016-05-17 14:45 ` [Qemu-devel] [PULL 02/20] s390x: enable runtime instrumentation Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 03/20] s390x/ipl: Extend the IplParameterBlock struct Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 04/20] s390x/ipl: Add type and length checks for IplParameterBlock values Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 05/20] s390x/ipl: Provide ipl parameter block Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 06/20] s390x/ipl: Add ssid field to IplParameterBlock Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 07/20] pc-bios/s390-ccw: Get device address via diag 308/6 Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 08/20] s390-ccw.img: rebuild image Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 09/20] s390x/ipl: Remove redundant usage of gr7 Cornelia Huck
2016-05-18 10:01   ` Paolo Bonzini
2016-05-18 10:09     ` Christian Borntraeger
2016-05-18 10:37       ` Paolo Bonzini
2016-05-17 14:46 ` [Qemu-devel] [PULL 10/20] hw/char: QOM'ify sclpconsole-lm.c Cornelia Huck
2016-05-17 14:46 ` Cornelia Huck [this message]
2016-05-17 14:46 ` [Qemu-devel] [PULL 12/20] s390x/pci: fix reg_irqs() Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 13/20] s390x/pci: separate s390_sclp_configure function Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 14/20] s390x/pci: separate s390_pcihost_iommu_configure function Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 15/20] s390x/pci: export pci_dereg_ioat and pci_dereg_irqs Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 16/20] s390x/pci: introduce S390PCIBusDevice.iommu_enabled Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 17/20] s390x/pci: fix s390_pci_sclp_deconfigure Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 18/20] s390x/pci: enhance mpcifc_service_call Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 19/20] s390x/pci: add length checking for pci sclp handlers Cornelia Huck
2016-05-17 14:46 ` [Qemu-devel] [PULL 20/20] s390x/pci: remove whitespace Cornelia Huck
2016-05-17 16:26 ` [Qemu-devel] [PULL 00/20] First round of s390x patches for 2.7 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463496377-9729-12-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zxq_yx_007@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).