hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
PATCH 1/1 hw/scsi/vmw_pvscsi: Use qbus_reset_all() directly
Since the BusState is accesible from the SCSIBus object, it is pointless to use qbus_reset_all_fn.
Use qbus_reset_all() directly.
---
One step toward removing qbus_reset_all_fn()
--- hw/scsi/vmw_pvscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/vmw_pvscsi.c +2 -2
@@ -440,7 +440,7 @@ static void pvscsi_reset_adapter(PVSCSIState *s) { s->resetting++; -qbus_reset_all_fn (&s->bus); +qbus_reset_all (&s->bus.qbus); s->resetting--;pvscsi_process_completion_queue (s);assert (QTAILQ_EMPTY (&s->pending_queue));
@@ -848,7 +848,7 @@ pvscsi_on_cmd_reset_bus(PVSCSIState *s)trace_pvscsi_on_cmd_arrived ("PVSCSI_CMD_RESET_BUS" ); s->resetting++; -qbus_reset_all_fn (&s->bus); +qbus_reset_all (&s->bus.qbus); s->resetting--;return PVSCSI_COMMAND_PROCESSING_SUCCEEDED ; }
Signature · 1 line
2.20.1
Quoted 17 lines · Philippe Mathieu-Daudé
Since the BusState is accesible from the SCSIBus object, it is pointless to use
qbus_reset_all_fn.
Useqbus_reset_all()directly.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
One step toward removingqbus_reset_all_fn()--- hw/scsi/vmw_pvscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/scsi/vmw_pvscsi.c +0
-0
hw/scsi/vmw_pvscsi.c static void · line 443
Quoted 5 lines
hw/scsi/vmw_pvscsi.c +1
-1@@ -440,7 +440,7 @@ static void pvscsi_reset_adapter(PVSCSIState *s) { s->resetting++; -qbus_reset_all_fn (&s->bus); +qbus_reset_all (&s->bus.qbus);
I thought our QOM style prefers using "BUS(&s->bus)" rather than looking inside the definition of the SCSIBus struct with "s->bus.qbus" ? (Compare preferring "DEVICE(s)" to "s->qdev".)
thanks
-- PMM
Quoted 13 lines · Peter Maydell
Quoted 12 lines · Philippe Mathieu-Daudé
Since the BusState is accesible from the SCSIBus object, it is pointless to use
qbus_reset_all_fn.
Useqbus_reset_all()directly.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
One step toward removingqbus_reset_all_fn()--- hw/scsi/vmw_pvscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines
hw/scsi/vmw_pvscsi.c static void · line 443
Quoted 10 lines
hw/scsi/vmw_pvscsi.c +1
-1@@ -440,7 +440,7 @@ static void pvscsi_reset_adapter(PVSCSIState *s) { s->resetting++; -qbus_reset_all_fn (&s->bus); +qbus_reset_all (&s->bus.qbus);I thought our QOM style prefers using "
BUS(&s->bus)" rather than looking inside the definition of the SCSIBus struct with "s->bus.qbus" ? (Compare preferring "DEVICE(s)" to "s->qdev".)
This is not explicit in HACKING/CODING_STYLE, but I agree this is cleaner and better to treat the generic QOM objects as opaque, and use the macros to check for the QOM type.
I'll respin.