[U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning

Wolfgang Denk wd at denx.de
Fri Sep 11 11:49:21 CEST 2009


Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
break strict-aliasing rules

Signed-off-by: Wolfgang Denk <wd at denx.de>
Cc: Guennadi Liakhovetski <lg at denx.de>
---
 board/linkstation/ide.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
index 2c89d62..5dd1d0e 100644
--- a/board/linkstation/ide.c
+++ b/board/linkstation/ide.c
@@ -54,10 +54,12 @@ int ide_preinit (void)
 	if (devbusfn == -1)
 		devbusfn = pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
 	if (devbusfn != -1) {
+		ulong *ide_bus_offset_ptr = &ide_bus_offset[0];
+
 		status = 0;
 
 		pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
-							   (u32 *) &ide_bus_offset[0]);
+							   (u32 *)ide_bus_offset_ptr);
 		ide_bus_offset[0] &= 0xfffffffe;
 		ide_bus_offset[0] = pci_hose_bus_to_phys(&hose,
 							 ide_bus_offset[0] & 0xfffffffe,
-- 
1.6.0.6



More information about the U-Boot mailing list