diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2013-09-20 23:06:24 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-09-25 14:44:34 +0000 |
commit | 322f7dcceab2b1a7363c722d80571a5fd8637328 (patch) | |
tree | 2af3c8c11cf698d262434f70fa617df5200e1334 | |
parent | 18fda50111ae7f70fd4e5d7651e8ebae9f7012f2 (diff) |
target: Fix strange ordering in target_read_u8
It's been like this since the check was added, in 5aa93a5e.
Change-Id: Iaa0586e0cd1ce57ad92735dcc3e51108a133fe96
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1640
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r-- | src/target/target.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/target/target.c b/src/target/target.c index fce1cd42..4a8d9aaa 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2031,12 +2031,13 @@ int target_read_u16(struct target *target, uint32_t address, uint16_t *value) int target_read_u8(struct target *target, uint32_t address, uint8_t *value) { - int retval = target_read_memory(target, address, 1, 1, value); if (!target_was_examined(target)) { LOG_ERROR("Target not examined yet"); return ERROR_FAIL; } + int retval = target_read_memory(target, address, 1, 1, value); + if (retval == ERROR_OK) { LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%2.2x", address, |