diff options
author | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-25 15:51:30 +0000 |
---|---|---|
committer | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-25 15:51:30 +0000 |
commit | 3c27bc8774ecff51bcc0cd4175b93a0229810833 (patch) | |
tree | ac2e959218ae1269e7af9ec0035c6436bca68e4a | |
parent | ad8f1b42956bdf463ce85ed741e1f62ba91ae62f (diff) | |
download | openocd+libswd-3c27bc8774ecff51bcc0cd4175b93a0229810833.tar.gz openocd+libswd-3c27bc8774ecff51bcc0cd4175b93a0229810833.tar.bz2 openocd+libswd-3c27bc8774ecff51bcc0cd4175b93a0229810833.tar.xz openocd+libswd-3c27bc8774ecff51bcc0cd4175b93a0229810833.zip |
Author: Raúl Sánchez Siles <rsanchezs@infoglobal.es>
- cfi flash_address coding style fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@1911 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/flash/cfi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/flash/cfi.c b/src/flash/cfi.c index dca9bef5..6e8b96e5 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -114,9 +114,11 @@ static __inline__ u32 flash_address(flash_bank_t *bank, int sector, u32 offset) { cfi_flash_bank_t *cfi_info = bank->driver_priv; + if(cfi_info->x16_as_x8) offset*=2; + /* while the sector list isn't built, only accesses to sector 0 work */ if (sector == 0) - return bank->base + (offset * bank->bus_width << cfi_info->x16_as_x8 ); + return bank->base + offset * bank->bus_width; else { if (!bank->sectors) @@ -124,7 +126,7 @@ static __inline__ u32 flash_address(flash_bank_t *bank, int sector, u32 offset) LOG_ERROR("BUG: sector list not yet built"); exit(-1); } - return bank->base + bank->sectors[sector].offset + (offset * bank->bus_width << cfi_info->x16_as_x8 ); + return bank->base + bank->sectors[sector].offset + offset * bank->bus_width; } } |