From patchwork Wed Dec 23 15:52:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 41676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 037B4B7BBF for ; Thu, 24 Dec 2009 02:54:25 +1100 (EST) Received: from localhost ([127.0.0.1]:37802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNTXa-0007JC-6u for incoming@patchwork.ozlabs.org; Wed, 23 Dec 2009 10:54:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNTX0-0007DI-KO for qemu-devel@nongnu.org; Wed, 23 Dec 2009 10:53:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNTWw-00079q-Oq for qemu-devel@nongnu.org; Wed, 23 Dec 2009 10:53:46 -0500 Received: from [199.232.76.173] (port=40794 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNTWw-00079h-Hu for qemu-devel@nongnu.org; Wed, 23 Dec 2009 10:53:42 -0500 Received: from bu3sch.de ([62.75.166.246]:56800 helo=vs166246.vserver.de) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NNTWw-0003Zz-2A for qemu-devel@nongnu.org; Wed, 23 Dec 2009 10:53:42 -0500 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1NNTWs-00053u-13 for qemu-devel@nongnu.org; Wed, 23 Dec 2009 15:53:38 +0000 From: Michael Buesch To: qemu-devel@nongnu.org Date: Wed, 23 Dec 2009 16:52:34 +0100 User-Agent: KMail/1.9.9 X-Move-Along: Nothing to see here. No, really... Nothing. MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200912231652.36165.mb@bu3sch.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH, RESEND] usb-ohci: Fix endianness issue X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- Resend. This patch was already sent on 2009/07/08, but the problem is still present in trunk. --- hw/usb-ohci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- trunk.orig/hw/usb-ohci.c +++ trunk/hw/usb-ohci.c @@ -1150,9 +1150,9 @@ static void ohci_frame_boundary(void *op /* 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)