From 4896c83ce8f28674a0beb34e7d475cb5b0ac7dab Mon Sep 17 00:00:00 2001 From: Paul Bartholomew Date: Wed, 25 Jul 2018 22:59:01 +0200 Subject: [PATCH] target/cortex_a: fix compile error for uninitialized variable Commit ad6c71e151590f9d07eb07eda978a8d2a845259c introduced the variable "mmu_enabled" whose pointer is passed to cortex_a_mmu() that initialises it. This initialization is not visible to the compiler that issue a compile error. The same situation is common across the same file and the usual workaround is to initialize it to zero; thus the same fix i applied here. Ticket: https://sourceforge.net/p/openocd/tickets/197/ Fixes: commit ad6c71e15159 ("cortex_a: fix virt2phys when mmu is disabled") Change-Id: I77dec41acdf4c715b45ae37b72e36719d96d9283 Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/4619 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- src/target/cortex_a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index b15dcb41..e4d8331b 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -3229,7 +3229,7 @@ static int cortex_a_virt2phys(struct target *target, struct armv7a_common *armv7a = target_to_armv7a(target); struct adiv5_dap *swjdp = armv7a->arm.dap; uint8_t apsel = swjdp->apsel; - int mmu_enabled; + int mmu_enabled = 0; /* * If the MMU was not enabled at debug entry, there is no -- 2.39.5