Minor cleanup in target.c

Small cleanup in target.c to get rid of few upstream differences:

- removed a pointless check for `reg->exists` - already checked
  few lines above
- unify one log message with what's in upstream

Change-Id: I3fd761157382670611fa90de84e2dfc90192f473
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
This commit is contained in:
Jan Matyas 2023-05-15 15:03:49 +02:00
parent e02c83e401
commit bd275ef483
1 changed files with 17 additions and 19 deletions

View File

@ -3107,7 +3107,6 @@ COMMAND_HANDLER(handle_reg_command)
if (reg->exist == false || reg->hidden)
continue;
/* only print cached values if they are valid */
if (reg->exist) {
if (reg->valid) {
char *value = buf_to_hex_str(reg->value,
reg->size);
@ -3125,7 +3124,6 @@ COMMAND_HANDLER(handle_reg_command)
reg->size);
}
}
}
cache = cache->next;
}
@ -3179,7 +3177,7 @@ COMMAND_HANDLER(handle_reg_command)
if (reg->valid == 0) {
int retval = reg->type->get(reg);
if (retval != ERROR_OK) {
LOG_DEBUG("Couldn't get register %s.", reg->name);
LOG_ERROR("Could not read register '%s'", reg->name);
return retval;
}
}