summaryrefslogtreecommitdiff
path: root/board/linkstation
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-11-07 22:43:37 +0100
committerWolfgang Denk <wd@denx.de>2011-11-07 22:43:37 +0100
commit53862da918937ec8ad1f44f8c4862e98d98d0e05 (patch)
tree420667c99a04f09f7b867ada645dccb6911362f6 /board/linkstation
parentafb92010b26c2089c8cf52fa17b505ea659cf5f0 (diff)
downloadu-boot-imx-53862da918937ec8ad1f44f8c4862e98d98d0e05.zip
u-boot-imx-53862da918937ec8ad1f44f8c4862e98d98d0e05.tar.gz
u-boot-imx-53862da918937ec8ad1f44f8c4862e98d98d0e05.tar.bz2
board/linkstation/ide.c: Fix GCC 4.6 build warnings
Fix: ide.c: In function 'ide_preinit': ide.c:69:21: warning: array subscript is above array bounds [-Warray-bounds] ide.c:69:21: warning: array subscript is above array bounds [-Warray-bounds] ide.c:70:17: warning: array subscript is above array bounds [-Warray-bounds] Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Diffstat (limited to 'board/linkstation')
-rw-r--r--board/linkstation/ide.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
index 568fdf5..f3e3fce 100644
--- a/board/linkstation/ide.c
+++ b/board/linkstation/ide.c
@@ -62,14 +62,16 @@ int ide_preinit (void)
&ide_bus_offset32);
ide_bus_offset[0] = ide_bus_offset32 & 0xfffffffe;
ide_bus_offset[0] = pci_hose_bus_to_phys(&hose,
- ide_bus_offset[0] & 0xfffffffe,
- PCI_REGION_IO);
- pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2,
- (u32 *) &ide_bus_offset[1]);
- ide_bus_offset[1] &= 0xfffffffe;
- ide_bus_offset[1] = pci_hose_bus_to_phys(&hose,
- ide_bus_offset[1] & 0xfffffffe,
- PCI_REGION_IO);
+ ide_bus_offset[0] & 0xfffffffe,
+ PCI_REGION_IO);
+ if (CONFIG_SYS_IDE_MAXBUS > 1) {
+ pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2,
+ (u32 *) &ide_bus_offset[1]);
+ ide_bus_offset[1] &= 0xfffffffe;
+ ide_bus_offset[1] = pci_hose_bus_to_phys(&hose,
+ ide_bus_offset[1] & 0xfffffffe,
+ PCI_REGION_IO);
+ }
}
if (pci_find_device (PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212, 0) != -1) {