[riscv-pmp]: PMP_is_locked function has redundant top pmp check
Goal
To remove redundant checks in the function pmp_is_locked
Technical details
https://gitlab.com/qemu-project/qemu/-/blob/master/target/riscv/pmp.c#L45-L58
In the risc-v pmp implementation, the check of top PMP will not change the return value, so consider delete it
static inline int pmp_is_locked(CPURISCVState *env, uint32_t pmp_index)
{
if (env->pmp_state.pmp[pmp_index].cfg_reg & PMP_LOCK) {
return 1;
}
// THIS check is redundant
/* Top PMP has no 'next' to check */
if ((pmp_index + 1u) >= MAX_RISCV_PMPS) {
return 0;
}
return 0;
}
Additional information
Edited by Dingisoul Reaper