target/riscv: fix build error with -Werror=maybe-uninitialized

using gcc 9.3 on ubuntu focal fossa with -Werror=maybe-uninitialized
we get this error:
  /src/target/riscv/riscv.c: In function ‘riscv_address_translate’:
  /src/target/riscv/riscv.c:1536:13: error: ‘pte’ may be used uninitialized

Change-Id: I51e180b43f9b6996e4e4058db49c179b9f81bcdc
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6013
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Tarek BOCHKATI 2021-01-11 19:23:58 +01:00 committed by Antonio Borneo
parent 310c9800c7
commit 404993b29f
1 changed files with 1 additions and 1 deletions

View File

@ -1446,7 +1446,7 @@ static int riscv_address_translate(struct target *target,
uint64_t ppn_value;
target_addr_t table_address;
virt2phys_info_t *info;
uint64_t pte;
uint64_t pte = 0;
int i;
if (riscv_rtos_enabled(target))