diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-08 11:41:10 +1100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-03-13 10:52:25 +0100 |
commit | e2854bf3239f57d160cfe5230033110c0c0d2837 (patch) | |
tree | 146629ac34d4e71bf9e9918613fcf160c27d5353 /hw/usb/dev-storage.c | |
parent | 6c60134091cb2754d810b012773754967d8bbf92 (diff) |
Endian fix an assertion in usb-msd
This fixes a broken endian assumption in an assertion in usb-msd.
Cc: Gerd Hoffman <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r-- | hw/usb/dev-storage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 6ffaf70661..bdbe7bdd11 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -193,9 +193,9 @@ static void usb_msd_send_status(MSDState *s, USBPacket *p) int len; DPRINTF("Command status %d tag 0x%x, len %zd\n", - s->csw.status, s->csw.tag, p->iov.size); + s->csw.status, le32_to_cpu(s->csw.tag), p->iov.size); - assert(s->csw.sig == 0x53425355); + assert(s->csw.sig == cpu_to_le32(0x53425355)); len = MIN(sizeof(s->csw), p->iov.size); usb_packet_copy(p, &s->csw, len); memset(&s->csw, 0, sizeof(s->csw)); @@ -233,7 +233,7 @@ static void usb_msd_command_complete(SCSIRequest *req, uint32_t status, size_t r s->csw.sig = cpu_to_le32(0x53425355); s->csw.tag = cpu_to_le32(req->tag); - s->csw.residue = s->residue; + s->csw.residue = cpu_to_le32(s->residue); s->csw.status = status != 0; if (s->packet) { |