Patchwork [U-Boot,v3,2/5] usb: ehci: Fix aliasing issue in EHCI interrupt code

login
register
mail settings
Submitter Simon Glass
Date March 7, 2013, 12:08 a.m.
Message ID <1362614916-26382-3-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/225683/
State Accepted, archived
Delegated to: Marek Vasut
Headers show

Comments

Simon Glass - March 7, 2013, 12:08 a.m.
From: Vincent Palatin <vpalatin@chromium.org>

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>

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3: None
Changes in v2: None

 drivers/usb/host/ehci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 46b535f..d090f0a 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -247,7 +247,7 @@  struct QH {
 	 * aligned to 32 bytes
 	 */
 	union {
-		uint8_t fill[16];
+		uint32_t fill[4];
 		void *buffer;
 	};
 };