Patchwork [03/41] virtio: Teach virtio-console about DO_UPCAST

login
register
mail settings
Submitter Juan Quintela
Date Dec. 2, 2009, 12:04 p.m.
Message ID <ffc05aa36f3685c523482528d6876ac55a6794ba.1259754427.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/40008/
State New
Headers show

Comments

Juan Quintela - Dec. 2, 2009, 12:04 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/virtio-console.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

Patch

diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 57f8f89..e0afe61 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -24,14 +24,9 @@  typedef struct VirtIOConsole
     CharDriverState *chr;
 } VirtIOConsole;

-static VirtIOConsole *to_virtio_console(VirtIODevice *vdev)
-{
-    return (VirtIOConsole *)vdev;
-}
-
 static void virtio_console_handle_output(VirtIODevice *vdev, VirtQueue *vq)
 {
-    VirtIOConsole *s = to_virtio_console(vdev);
+    VirtIOConsole *s = DO_UPCAST(VirtIOConsole, vdev, vdev);
     VirtQueueElement elem;

     while (virtqueue_pop(vq, &elem)) {