From: Loïc Lefort Date: Thu, 13 Mar 2025 19:30:11 +0000 (+0100) Subject: target/riscv: pmp: remove redundant check in pmp_is_locked X-Git-Tag: v10.1.0-rc0~83^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=986222f0f994671190a94836a373fd64992cd271;p=thirdparty%2Fqemu.git target/riscv: pmp: remove redundant check in pmp_is_locked Remove useless check in pmp_is_locked, the function will return 0 in either case. Signed-off-by: Loïc Lefort Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei Message-ID: <20250313193011.720075-6-loic@rivosinc.com> Signed-off-by: Alistair Francis --- diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 4070e21ea37..5af295e410b 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -59,11 +59,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; }