[Top] [All Lists]

Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS55

To: "Oliver Neukum" <>
Subject: Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
From: "Thomas Dahlmann" <>
Date: Tue, 10 Jan 2006 12:02:09 +0100
Cc:, "Jordan Crouse" <>,,,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Oliver Neukum wrote:

Am Montag, 9. Januar 2006 19:03 schrieb Jordan Crouse:
From the "two-birds-one-stone" department, I am pleased to present USB UDC
support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge. Also, coming soon (in the next few days), OTG, which has been removed from
the usb_host patch, and put into its own patch (as per David's comments).

This patch is against current linux-mips git, but it should apply for Linus's
tree as well.


+        VDBG("udc_read_bytes(): %d bytes\n", bytes);
+        /* dwords first */
+        for (i = 0; i < bytes / UDC_DWORD_BYTES; i++) {
+ *((u32*) (buf + (i<<2))) = readl(dev->rxfifo); + }

Is there any reason you don't increment by 4?


The loop is for reading dwords only, so "i < bytes / UDC_DWORD_BYTES" cuts
off remaining 1,2 or 3 bytes which are handled by the next loop.
But you are right, incrementing by 4 may look better,  as

       for (i = 0; i < bytes - bytes % UDC_DWORD_BYTES; i+=4) {
*((u32*) (buf + i)) = readl(dev->rxfifo); }


<Prev in Thread] Current Thread [Next in Thread>