target: Make use of str_enabled_disabled()

The data type changes introduced in [1,2] lead to implicit casts from a
boolean to an integer value in the string selection between "enabled" and
"disabled".

Use str_enabled_disabled() to get rid of this implicit cast.

[1] https://review.openocd.org/c/openocd/+/8988
[2] https://review.openocd.org/c/openocd/+/8992

Change-Id: Ia98abdd43b42f394f5bf0aa845017dfbb0e087fd
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9007
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2025-07-20 11:33:38 +00:00
committed by Antonio Borneo
parent bd32290864
commit c2b8f994bf
6 changed files with 25 additions and 43 deletions

View File

@@ -22,6 +22,7 @@
#include "arm_simulator.h"
#include "arm_disassembler.h"
#include <helper/time_support.h>
#include <helper/string_choices.h>
#include "register.h"
#include "image.h"
#include "arm_opcodes.h"
@@ -774,10 +775,6 @@ static int xscale_arch_state(struct target *target)
struct xscale_common *xscale = target_to_xscale(target);
struct arm *arm = &xscale->arm;
static const char *state[] = {
"disabled", "enabled"
};
static const char *arch_dbg_reason[] = {
"", "\n(processor reset)", "\n(trace buffer full)"
};
@@ -789,9 +786,9 @@ static int xscale_arch_state(struct target *target)
arm_arch_state(target);
LOG_USER("MMU: %s, D-Cache: %s, I-Cache: %s%s",
state[xscale->armv4_5_mmu.mmu_enabled],
state[xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled],
state[xscale->armv4_5_mmu.armv4_5_cache.i_cache_enabled],
str_enabled_disabled(xscale->armv4_5_mmu.mmu_enabled),
str_enabled_disabled(xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled),
str_enabled_disabled(xscale->armv4_5_mmu.armv4_5_cache.i_cache_enabled),
arch_dbg_reason[xscale->arch_debug_reason]);
return ERROR_OK;