summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2010-04-14 16:32:30 +0800
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-04-15 19:19:46 +0200
commitc9e58238c3b1ae181a7d54bc5255ef98771493c2 (patch)
tree0bf1c99958bc2bd3d73c3bcd6ca17eef5936ef40 /src
parentee139164114460d5c4c1a720e28740a7dceca712 (diff)
downloadopenocd_libswd-c9e58238c3b1ae181a7d54bc5255ef98771493c2.tar.gz
openocd_libswd-c9e58238c3b1ae181a7d54bc5255ef98771493c2.tar.bz2
openocd_libswd-c9e58238c3b1ae181a7d54bc5255ef98771493c2.tar.xz
openocd_libswd-c9e58238c3b1ae181a7d54bc5255ef98771493c2.zip
NOR/CFI: fix order of arguments check
Syntax of "flash bank" command requires: - chip_width as CMD_ARGV[3] - bus_width as CMD_ARGV[4] Actual code swaps the arguments. Bug has no run time impact since wrong variables are only used to check value and both are checked against same constraint. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/flash/nor/cfi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c
index 4dad7b6f..325dce90 100644
--- a/src/flash/nor/cfi.c
+++ b/src/flash/nor/cfi.c
@@ -599,8 +599,8 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command)
}
uint16_t chip_width, bus_width;
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[3], bus_width);
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[4], chip_width);
+ COMMAND_PARSE_NUMBER(u16, CMD_ARGV[3], chip_width);
+ COMMAND_PARSE_NUMBER(u16, CMD_ARGV[4], bus_width);
if ((chip_width > CFI_MAX_CHIP_WIDTH)
|| (bus_width > CFI_MAX_BUS_WIDTH))