From 3ce70962d144406adb58a34f892dc370df9d5475 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Thu, 5 Aug 2021 00:37:32 +0200 Subject: [PATCH] arm_adi_v5: use macro DP_APSEL_MAX in place of magic number Commit 11019a824d02 ("adi_v5: enforce check on AP number value") introduces the macro DP_APSEL_MAX and use it in place of hardcoded magic numbers for the upper limit of AP selection value. Fix one more place where the macro should be used. Change-Id: I6c57f72405c69bbb40924221309d95dfeb5f7540 Signed-off-by: Antonio Borneo Fixes: 11019a824d02 ("adi_v5: enforce check on AP number value") Reviewed-on: http://openocd.zylin.com/6415 Reviewed-by: Tomas Vanek Tested-by: jenkins Reviewed-by: Tarek BOCHKATI --- src/target/arm_adi_v5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 2bb11b25ec..0c4b80ca19 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -648,7 +648,7 @@ void dap_invalidate_cache(struct adiv5_dap *dap) dap->last_read = NULL; int i; - for (i = 0; i <= 255; i++) { + for (i = 0; i <= DP_APSEL_MAX; i++) { /* force csw and tar write on the next mem-ap access */ dap->ap[i].tar_valid = false; dap->ap[i].csw_value = 0; -- 2.30.2