summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-01-05 21:21:33 +0000
committerStefan Reinauer <reinauer@chromium.org>2012-01-05 14:59:51 -0800
commit17b3e106d1da893de82dac51888e9515f689ea51 (patch)
treeefd513027f6eadd9fe032a728259f21bfc7e5df2 /drivers
parentc9e4b38ad28e10703a9d16aacca51aa650fdb98b (diff)
usb: fix aliasing issue in EHCI interrupt code
The interrupt endpoint handling code stores the buffer pointer in the QH padding field. We need to make it the size of a pointer to avoid strict aliasing issue with the compiler. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chromium-os:24760 TEST=emerge-lumpy chromeos-u-boot ; emerge-tegra2_kaen chromeos-u-boot Change-Id: Iecbfa0610591d24452106b79de61abb033c36f2e Reviewed-on: https://gerrit.chromium.org/gerrit/13732 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 559b19da0c..d9ae89e3cf 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1185,7 +1185,7 @@ poll_int_queue(struct usb_device *dev, struct int_queue *queue)
debug("Exit poll_int_queue with completed intr transfer. "
"token is %x at %p (first at %p)\n", cur->qh_overlay.qt_token,
&cur->qh_overlay.qt_token, queue->first);
- return *(void **)cur->fill;
+ return (void *)cur->fill[0];
}
/* Do not free buffers associated with QHs, they're owned by someone else */
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 0b7bbbf2c8..3ac27e0f26 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -208,7 +208,7 @@ struct QH {
* Add dummy fill value to make the size of this struct
* aligned to 32 bytes
*/
- uint8_t fill[16];
+ uint32_t fill[4];
};
/* Low level init functions */