提交 e2854bf3 编写于 作者: B Benjamin Herrenschmidt 提交者: Gerd Hoffmann

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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 6c601340
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册