target/riscv: Remove redundant check in pmp_is_locked
PATCH 1/2 target/riscv: Remove redundant check in pmp_is_locked
the check of top PMP is redundant and will not influence the return value, so consider remove it
Signed-off-by Ruibo Lu <[email protected]>
--- target/riscv/pmp.c | 5 ----- 1 file changed, 5 deletions(-)
target/riscv/pmp.c +0 -5
@@ -49,11 +49,6 @@ static inline int pmp_is_locked(CPURISCVState *env, uint32_t pmp_index)return 1 ; } -/* Top PMP has no 'next' to check */ -if ((pmp_index +1u ) >=MAX_RISCV_PMPS ) { -return 0 ; - } -return 0 ; }
Signature · 1 line
2.41.0
Quoted 5 lines · Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it
Signed-off-by Ruibo Lu <[email protected]>---
Reviewed-by Weiwei Li <[email protected]>
Weiwei Li
Quoted 19 lines
target/riscv/pmp.c | 5 ----- 1 file changed, 5 deletions(-)target/riscv/pmp.c +0
-5@@ -49,11 +49,6 @@ static inline int pmp_is_locked(CPURISCVState *env, uint32_t pmp_index)return 1 ; } -/* Top PMP has no 'next' to check */ -if ((pmp_index +1u ) >=MAX_RISCV_PMPS ) { -return 0 ; - } -return 0 ; }
Quoted 5 lines · Ruibo Lu
the check of top PMP is redundant and will not influence the return value, so consider remove it
Signed-off-by Ruibo Lu <[email protected]>
Reviewed-by Alistair Francis <[email protected]>
Alistair
Quoted 24 lines
--- target/riscv/pmp.c | 5 ----- 1 file changed, 5 deletions(-)target/riscv/pmp.c +0
-6@@ -49,11 +49,6 @@ static inline int pmp_is_locked(CPURISCVState *env, uint32_t pmp_index)return 1 ; } -/* Top PMP has no 'next' to check */ -if ((pmp_index +1u ) >=MAX_RISCV_PMPS ) { -return 0 ; - } -return 0 ; } --2.41.0