diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-08-30 08:38:26 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-09-27 07:32:30 +0200 |
commit | cea5aa85691d7f26b7ea995417d41a32802691b7 (patch) | |
tree | 1b383a9ad8d5ff0729ac4c8da1d5370a1cec8f5a /hw/usb/dev-storage.c | |
parent | d8c2e6f2f6d29ccb766197181eb1c65c1d46b3a4 (diff) | |
download | qemu-cea5aa85691d7f26b7ea995417d41a32802691b7.zip qemu-cea5aa85691d7f26b7ea995417d41a32802691b7.tar.gz qemu-cea5aa85691d7f26b7ea995417d41a32802691b7.tar.bz2 |
usb/msd: move usb_msd_packet_complete()
Change ordering to avoid adding forward declarations in
following patches. Fix comment code style while being
at it. No functional change.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20220830063827.813053-2-kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r-- | hw/usb/dev-storage.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 9863969..140ef2a 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -177,6 +177,20 @@ static const USBDesc desc = { .str = desc_strings, }; +static void usb_msd_packet_complete(MSDState *s) +{ + USBPacket *p = s->packet; + + /* + * Set s->packet to NULL before calling usb_packet_complete + * because another request may be issued before + * usb_packet_complete returns. + */ + trace_usb_msd_packet_complete(); + s->packet = NULL; + usb_packet_complete(&s->dev, p); +} + static void usb_msd_copy_data(MSDState *s, USBPacket *p) { uint32_t len; @@ -208,18 +222,6 @@ static void usb_msd_send_status(MSDState *s, USBPacket *p) memset(&s->csw, 0, sizeof(s->csw)); } -static void usb_msd_packet_complete(MSDState *s) -{ - USBPacket *p = s->packet; - - /* Set s->packet to NULL before calling usb_packet_complete - because another request may be issued before - usb_packet_complete returns. */ - trace_usb_msd_packet_complete(); - s->packet = NULL; - usb_packet_complete(&s->dev, p); -} - void usb_msd_transfer_data(SCSIRequest *req, uint32_t len) { MSDState *s = DO_UPCAST(MSDState, dev.qdev, req->bus->qbus.parent); |