|
From: openocd-gerrit <ope...@us...> - 2025-11-12 20:17:53
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 768b4084ebee3f59976f2eb15dd07a93407bc5ca (commit)
from bd303d6a3daa64a671eca6f951eaac88b86346de (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 768b4084ebee3f59976f2eb15dd07a93407bc5ca
Author: Antonio Borneo <bor...@gm...>
Date: Mon Aug 4 17:40:39 2025 +0200
target: riscv: don't test 'debug_level' directly
Use the macro 'LOG_LEVEL_IS()' to test 'debug_level'.
Change-Id: Ic931fd2eff0fa97a7a315b4b276f85dfc5fc8d5f
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9071
Reviewed-by: Evgeniy Naydanov <evg...@sy...>
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/target/riscv/batch.c b/src/target/riscv/batch.c
index 56143808f..5acbddaf3 100644
--- a/src/target/riscv/batch.c
+++ b/src/target/riscv/batch.c
@@ -204,7 +204,7 @@ static void log_batch(const struct riscv_batch *batch, size_t start_idx,
const struct riscv_scan_delays *delays, bool resets_delays,
size_t reset_delays_after)
{
- if (debug_level < LOG_LVL_DEBUG)
+ if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
return;
const unsigned int abits = riscv_get_dmi_address_bits(batch->target);
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c
index 139d555f8..801bcba7d 100644
--- a/src/target/riscv/riscv-011.c
+++ b/src/target/riscv/riscv-011.c
@@ -391,7 +391,7 @@ static void dump_field(const struct scan_field *field)
static const char * const op_string[] = {"nop", "r", "w", "?"};
static const char * const status_string[] = {"+", "?", "F", "b"};
- if (debug_level < LOG_LVL_DEBUG)
+ if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
return;
uint64_t out = buf_get_u64(field->out_value, 0, field->num_bits);
@@ -1934,7 +1934,7 @@ static int poll_target(struct target *target, bool announce)
/* Inhibit debug logging during poll(), which isn't usually interesting and
* just fills up the screen/logs with clutter. */
int old_debug_level = debug_level;
- if (debug_level >= LOG_LVL_DEBUG)
+ if (LOG_LEVEL_IS(LOG_LVL_DEBUG))
debug_level = LOG_LVL_INFO;
bits_t bits = {
.haltnot = 0,
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 2a947bd69..9da9684e4 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -368,7 +368,7 @@ static struct riscv_debug_reg_ctx get_riscv_debug_reg_ctx(const struct target *t
static void log_debug_reg(struct target *target, enum riscv_debug_reg_ordinal reg,
riscv_reg_t value, const char *file, unsigned int line, const char *func)
{
- if (debug_level < LOG_LVL_DEBUG)
+ if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
return;
const struct riscv_debug_reg_ctx context = get_riscv_debug_reg_ctx(target);
char * const buf = malloc(riscv_debug_reg_to_s(NULL, reg, context, value, RISCV_DEBUG_REG_HIDE_UNNAMED_0) + 1);
@@ -735,7 +735,7 @@ int riscv013_execute_abstract_command(struct target *target, uint32_t command,
{
assert(cmderr);
*cmderr = CMDERR_NONE;
- if (debug_level >= LOG_LVL_DEBUG) {
+ if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
switch (get_field(command, DM_COMMAND_CMDTYPE)) {
case 0:
LOG_DEBUG_REG(target, AC_ACCESS_REGISTER, command);
@@ -3094,7 +3094,7 @@ static int execute_autofence(struct target *target)
static void log_memory_access128(target_addr_t address, uint64_t value_h,
uint64_t value_l, bool is_read)
{
- if (debug_level < LOG_LVL_DEBUG)
+ if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
return;
char fmt[80];
@@ -3106,7 +3106,7 @@ static void log_memory_access128(target_addr_t address, uint64_t value_h,
static void log_memory_access64(target_addr_t address, uint64_t value,
unsigned int size_bytes, bool is_read)
{
- if (debug_level < LOG_LVL_DEBUG)
+ if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
return;
char fmt[80];
-----------------------------------------------------------------------
Summary of changes:
src/target/riscv/batch.c | 2 +-
src/target/riscv/riscv-011.c | 4 ++--
src/target/riscv/riscv-013.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|