target/target: Use boolean values for 'valid' flag

Change-Id: Ieaa25b9ef0997c0f75ddfb652325c1a9e53a8d8d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7959
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
This commit is contained in:
Marc Schink 2023-11-03 11:04:08 +01:00 committed by Antonio Borneo
parent 59c4d35fa4
commit f58b5ddaf2
1 changed files with 2 additions and 2 deletions

View File

@ -3139,9 +3139,9 @@ COMMAND_HANDLER(handle_reg_command)
if ((CMD_ARGC == 1) || ((CMD_ARGC == 2) && !((CMD_ARGV[1][0] >= '0') if ((CMD_ARGC == 1) || ((CMD_ARGC == 2) && !((CMD_ARGV[1][0] >= '0')
&& (CMD_ARGV[1][0] <= '9')))) { && (CMD_ARGV[1][0] <= '9')))) {
if ((CMD_ARGC == 2) && (strcmp(CMD_ARGV[1], "force") == 0)) if ((CMD_ARGC == 2) && (strcmp(CMD_ARGV[1], "force") == 0))
reg->valid = 0; reg->valid = false;
if (reg->valid == 0) { if (!reg->valid) {
int retval = reg->type->get(reg); int retval = reg->type->get(reg);
if (retval != ERROR_OK) { if (retval != ERROR_OK) {
LOG_ERROR("Could not read register '%s'", reg->name); LOG_ERROR("Could not read register '%s'", reg->name);