From f72ba552d57df674ee83defb5e37612226035041 Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Tue, 19 Nov 2019 16:25:08 +0800 Subject: [PATCH] riscv: fix formatting errors. --- src/target/riscv/riscv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 88c180092..d7d9651ad 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1451,7 +1451,7 @@ static int riscv_address_translate(struct target *target, if (!(pte & PTE_V) || (!(pte & PTE_R) && (pte & PTE_W))) return ERROR_FAIL; - if ((pte & PTE_R) || (pte & PTE_X)) // Found leaf PTE. + if ((pte & PTE_R) || (pte & PTE_X)) /* Found leaf PTE. */ break; i--; @@ -1514,9 +1514,9 @@ static int riscv_read_memory(struct target *target, target_addr_t address, return ERROR_FAIL; target_addr_t physical_addr; - if (target->type->virt2phys(target, address, &physical_addr) == ERROR_OK) { + if (target->type->virt2phys(target, address, &physical_addr) == ERROR_OK) address = physical_addr; - } + struct target_type *tt = get_target_type(target); return tt->read_memory(target, address, size, count, buffer); } @@ -1537,9 +1537,9 @@ static int riscv_write_memory(struct target *target, target_addr_t address, return ERROR_FAIL; target_addr_t physical_addr; - if (target->type->virt2phys(target, address, &physical_addr) == ERROR_OK) { + if (target->type->virt2phys(target, address, &physical_addr) == ERROR_OK) address = physical_addr; - } + struct target_type *tt = get_target_type(target); return tt->write_memory(target, address, size, count, buffer); }