qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 1fa63e4] usb-ohci: Fix endianness issue


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 1fa63e4] usb-ohci: Fix endianness issue
Date: Fri, 10 Jul 2009 20:40:29 -0000

From: Michael Buesch <address@hidden>

This fixes a possible endianness issue in the usb-ohci hw module.
hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16().

Signed-off-by: Michael Buesch <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 23b5e21..83d1a5c 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1150,9 +1150,9 @@ static void ohci_frame_boundary(void *opaque)
     /* Frame boundary, so do EOF stuf here */
     ohci->frt = ohci->fit;
 
-    /* XXX: endianness */
+    /* Increment frame number and take care of endianness. */
     ohci->frame_number = (ohci->frame_number + 1) & 0xffff;
-    hcca.frame = cpu_to_le32(ohci->frame_number);
+    hcca.frame = cpu_to_le16(ohci->frame_number);
 
     if (ohci->done_count == 0 && !(ohci->intr_status & OHCI_INTR_WD)) {
         if (!ohci->done)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]