Skip to contentSkip to conversation

scsi-bus: use DO_UPCAST.

PATCH Applied Zhi Yong Wu 3 participants 3 messages Aug 4, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi-bus: use DO_UPCAST.

---
 hw/scsi-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/scsi-bus.c +1 -1
index ad6a730..f6c416e 100644
@@ -712,7 +712,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev)
 
 static char *scsibus_get_fw_dev_path(DeviceState *dev)
 {
-    SCSIDevice *d = (SCSIDevice*)dev;
+    SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev);
     SCSIBus *bus = scsi_bus_from_device(d);
     char path[100];
     int i;
Signature · 1 line
1.7.2.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Zhi Yong Wu
---
 hw/scsi-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/scsi-bus.c +0 -0
index ad6a730..f6c416e 100644

hw/scsi-bus.c void scsi_device_purge_requests(SCSIDevice *sdev) · line 718

Quoted 8 lines
hw/scsi-bus.c +1 -1
@@ -712,7 +712,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev)
 
 static char *scsibus_get_fw_dev_path(DeviceState *dev)
 {
-    SCSIDevice *d = (SCSIDevice*)dev;
+    SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev);
     SCSIBus *bus = scsi_bus_from_device(d);
     char path[100];
     int i;