Unaligned access in EHCI driver
"Max Dmitrichenko" <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi! I get following warnings on spar64: Kernel unaligned access at TPC[1000c9e4] ehci_hub_control+0x54c/0x68c [ehci_hcd] Despite of the comment in the patched code, the type cast used there does make unaligned access. The fix was made as it's done in ohci-hub.c. --- Best regards, Max ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ehci.patch
(text/x-diff, 739 B)
diff -buprN -X linux-source-2.6.18/Documentation/dontdiff linux-source-2.6.18/drivers/usb/host/ehci-hub.c linux-source-2.6.18.patched/drivers/usb/host/ehci-hub.c
--- linux-source-2.6.18/drivers/usb/host/ehci-hub.c 2006-09-20 07:42:06.000000000 +0400
+++ linux-source-2.6.18.patched/drivers/usb/host/ehci-hub.c 2007-03-02 03:11:34.000000000 +0300
@@ -492,8 +492,7 @@ static int ehci_hub_control (
if (status & ~0xffff) /* only if wPortChange is interesting */
#endif
dbg_port (ehci, "GetStatus", wIndex + 1, temp);
- // we "know" this alignment is good, caller used kmalloc()...
- *((__le32 *) buf) = cpu_to_le32 (status);
+ put_unaligned(cpu_to_le32 (status), (__le32 *) buf);
break;
case SetHubFeature:
switch (wValue) {