qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ruibo Lu <reaperlu@hust.edu.cn>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, luruibo2000@163.com,
	alistair.francis@wdc.com, liweiwei@iscas.ac.cn
Subject: [PATCH 1/2] target/riscv: Remove redundant check in pmp_is_locked
Date: Wed, 28 Jun 2023 18:36:51 +0800	[thread overview]
Message-ID: <20230628103651.55194-1-reaperlu@hust.edu.cn> (raw)

the check of top PMP is redundant and will not influence the return
value, so consider remove it

Signed-off-by: Ruibo Lu <reaperlu@hust.edu.cn>
---
 target/riscv/pmp.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index 9d8db493e6..1a9279ba88 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -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



             reply	other threads:[~2023-06-28 13:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 10:36 Ruibo Lu [this message]
2023-06-28 13:21 ` [PATCH 1/2] target/riscv: Remove redundant check in pmp_is_locked Weiwei Li
2023-07-03  2:42 ` Alistair Francis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230628103651.55194-1-reaperlu@hust.edu.cn \
    --to=reaperlu@hust.edu.cn \
    --cc=alistair.francis@wdc.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=luruibo2000@163.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).