From f58b5ddaf27d899eca72c8707e32f1c3cfc25551 Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Fri, 3 Nov 2023 11:04:08 +0100 Subject: [PATCH] target/target: Use boolean values for 'valid' flag Change-Id: Ieaa25b9ef0997c0f75ddfb652325c1a9e53a8d8d Signed-off-by: Marc Schink Reviewed-on: https://review.openocd.org/c/openocd/+/7959 Tested-by: jenkins Reviewed-by: Antonio Borneo Reviewed-by: Jan Matyas --- src/target/target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index 10d0088d5..384b4ec84 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3139,9 +3139,9 @@ COMMAND_HANDLER(handle_reg_command) if ((CMD_ARGC == 1) || ((CMD_ARGC == 2) && !((CMD_ARGV[1][0] >= '0') && (CMD_ARGV[1][0] <= '9')))) { 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); if (retval != ERROR_OK) { LOG_ERROR("Could not read register '%s'", reg->name);