From 17b3e106d1da893de82dac51888e9515f689ea51 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 5 Jan 2012 21:21:33 +0000 Subject: 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 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 Tested-by: Vincent Palatin Reviewed-by: Stefan Reinauer --- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') 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 */ -- cgit v1.2.3