From: Øyvind H. <go...@us...> - 2010-06-14 12:29:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b6a82540654f02dbf4caaed1be538044220dd3dc (commit) via f3ae52cace69f9568bac719d50af3a62993e96ad (commit) from 18918a0423e04180f580a4a9453e190488aab17d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b6a82540654f02dbf4caaed1be538044220dd3dc Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 14 12:08:46 2010 +0200 flash: fix bug in error propagation of flash write_image when a write/unlock/erase failed during write_image, then an error was not propagated back up so e.g. flash write image from tcl scripts would not throw an exception. Also flash filling speed was printed even when the operation failed. Output is now less confusing. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 714cbe4..c134317 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -2383,8 +2383,6 @@ static int cfi_probe(struct flash_bank *bank) */ if (cfi_info->not_cfi == 0) { - int retval; - /* enter CFI query mode * according to JEDEC Standard No. 68.01, * a single bus sequence with address = 0x55, data = 0x98 should put @@ -2716,7 +2714,7 @@ static int cfi_protect_check(struct flash_bank *bank) return ERROR_OK; } -static int cfi_info(struct flash_bank *bank, char *buf, int buf_size) +static int get_cfi_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2806,5 +2804,5 @@ struct flash_driver cfi_flash = { /* FIXME: access flash at bus_width size */ .erase_check = default_flash_blank_check, .protect_check = cfi_protect_check, - .info = cfi_info, + .info = get_cfi_info, }; diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index d2f2754..84408e6 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -599,7 +599,6 @@ int flash_write_unlock(struct target *target, struct image *image, } /* find the corresponding flash bank */ - int retval; retval = get_flash_bank_by_addr(target, run_address, false, &c); if (retval != ERROR_OK) return retval; diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 3d67327..28a504e 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -576,7 +576,7 @@ COMMAND_HANDLER(handle_flash_fill_command) } } - if (duration_measure(&bench) == ERROR_OK) + if ((retval == ERROR_OK) && (duration_measure(&bench) == ERROR_OK)) { command_print(CMD_CTX, "wrote %" PRIu32 " bytes to 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)", wrote, address, commit f3ae52cace69f9568bac719d50af3a62993e96ad Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jun 14 12:10:35 2010 +0200 helper: fix -Wshadow warning in number parsing use obtuse local variable names in macros to avoid interfering with global name space Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/command.h b/src/helper/command.h index 2c19241..1bf2cb4 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -387,11 +387,11 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t); */ #define COMMAND_PARSE_NUMBER(type, in, out) \ do { \ - int retval = parse_##type(in, &(out)); \ - if (ERROR_OK != retval) { \ + int retval_macro_tmp = parse_##type(in, &(out)); \ + if (ERROR_OK != retval_macro_tmp) { \ command_print(CMD_CTX, stringify(out) \ " option value ('%s') is not valid", in); \ - return retval; \ + return retval_macro_tmp; \ } \ } while (0) @@ -404,13 +404,13 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t); #define COMMAND_PARSE_BOOL(in, out, on, off) \ do { \ bool value; \ - int retval = command_parse_bool_arg(in, &value); \ - if (ERROR_OK != retval) { \ + int retval_macro_tmp = command_parse_bool_arg(in, &value); \ + if (ERROR_OK != retval_macro_tmp) { \ command_print(CMD_CTX, stringify(out) \ " option value ('%s') is not valid", in); \ command_print(CMD_CTX, " choices are '%s' or '%s'", \ on, off); \ - return retval; \ + return retval_macro_tmp; \ } \ out = value; \ } while (0) ----------------------------------------------------------------------- Summary of changes: src/flash/nor/cfi.c | 6 ++---- src/flash/nor/core.c | 1 - src/flash/nor/tcl.c | 2 +- src/helper/command.h | 12 ++++++------ 4 files changed, 9 insertions(+), 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |