From: Antonio Borneo Date: Wed, 14 Apr 2010 08:32:30 +0000 (+0800) Subject: NOR/CFI: fix order of arguments check X-Git-Tag: v0.5.0-rc1~746 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c9e58238c3b1ae181a7d54bc5255ef98771493c2;p=openocd 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 --- 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))