[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv2 5/5] virtio-blk: remove layout assumption
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCHv2 5/5] virtio-blk: remove layout assumption |
Date: |
Thu, 18 Mar 2010 11:42:50 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
Use container_of to remove assumption that vdev
is 1st member of device state.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio-blk.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 5f61469..ab52d1d 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -32,7 +32,7 @@ typedef struct VirtIOBlock
static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
{
- return (VirtIOBlock *)vdev;
+ return container_of(vdev, VirtIOBlock, vdev);
}
typedef struct VirtIOBlockReq
--
1.7.0.2.280.gc6f05