From 23572378150a004f483bf4772e97a261dd606f64 Mon Sep 17 00:00:00 2001 From: Marek Vrbka Date: Mon, 6 Nov 2023 17:03:04 +0100 Subject: [PATCH] target/riscv: Replace watchpoint value mask comparison value with macro. This patch replaces ~(typeof(watchpoint->mask))0 with WATCHPOINT_IGNORE_DATA_VALUE_MASK. This improves readability and moves the RISCV target in line with other targets. Change-Id: I15ac4d4ee76098b304d9b22f720911ba4329c190 Signed-off-by: Marek Vrbka --- src/target/riscv/riscv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index f7df471b45..57cc5c37b7 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1375,10 +1375,7 @@ static void trigger_from_watchpoint(struct trigger *trigger, int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint) { - // NOTE: typeof is needed because of upstream OpenOCD bug. This should be - // replaced by WATCHPOINT_IGNORE_DATA_VALUE_MASK once it is available - // See: https://review.openocd.org/c/openocd/+/7840 - if (watchpoint->mask != ~(typeof(watchpoint->mask))0) { + if (watchpoint->mask != WATCHPOINT_IGNORE_DATA_VALUE_MASK) { LOG_TARGET_ERROR(target, "Watchpoints on data values are not implemented"); return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; }