[PATCH] target/riscv: Drop stray '+' in pmp()

TANG Tiancheng posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260107-stray-v1-1-6658efecbb0b@linux.alibaba.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
target/riscv/csr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/riscv: Drop stray '+' in pmp()
Posted by TANG Tiancheng 1 month ago
Remove an unintended leading '+' left in target/riscv/csr.c (pmp()).

Fixes: cd633bea8b0
Signed-off-by: TANG Tiancheng <lyndra@linux.alibaba.com>
---
This patch fixes a stray '+' character that was accidentally introduced
in the PMP (Physical Memory Protection) CSR handling code in target/riscv/csr.c.

The issue was introduced in commit cd633bea8b0 as part of the PMP region
count configurable feature and causes a syntax error that prevents
compilation.

Fixes: cd633bea8b0
Link: https://lists.nongnu.org/archive/html/qemu-riscv/2025-06/msg00089.html
---
 target/riscv/csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 5c91658c3dc412c6f0e6db89120b935b4c0ea6cf..8c1312ab129f4fe6a21d4dff67b3a7d9ca175415 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -743,7 +743,7 @@ static RISCVException pmp(CPURISCVState *env, int csrno)
 {
     if (riscv_cpu_cfg(env)->pmp) {
         int max_pmpcfg = (env->priv_ver >= PRIV_VERSION_1_12_0) ?
-+                              CSR_PMPCFG15 : CSR_PMPCFG3;
+                               CSR_PMPCFG15 : CSR_PMPCFG3;
 
         if (csrno <= max_pmpcfg) {
             uint32_t reg_index = csrno - CSR_PMPCFG0;

---
base-commit: 0fc482b73d8e085d1375b4e17b0647fd2e6fe8f0
change-id: 20251225-stray-d48679fda4a0

Best regards,
-- 
TANG Tiancheng <lyndra@linux.alibaba.com>
Re: [PATCH] target/riscv: Drop stray '+' in pmp()
Posted by Daniel Henrique Barboza 1 month ago

On 1/7/26 4:57 AM, TANG Tiancheng wrote:
> Remove an unintended leading '+' left in target/riscv/csr.c (pmp()).
> 
> Fixes: cd633bea8b0
> Signed-off-by: TANG Tiancheng <lyndra@linux.alibaba.com>
> ---
> This patch fixes a stray '+' character that was accidentally introduced
> in the PMP (Physical Memory Protection) CSR handling code in target/riscv/csr.c.
> 
> The issue was introduced in commit cd633bea8b0 as part of the PMP region
> count configurable feature and causes a syntax error that prevents
> compilation.
> 
> Fixes: cd633bea8b0
> Link: https://lists.nongnu.org/archive/html/qemu-riscv/2025-06/msg00089.html
> ---

Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>

>   target/riscv/csr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> index 5c91658c3dc412c6f0e6db89120b935b4c0ea6cf..8c1312ab129f4fe6a21d4dff67b3a7d9ca175415 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -743,7 +743,7 @@ static RISCVException pmp(CPURISCVState *env, int csrno)
>   {
>       if (riscv_cpu_cfg(env)->pmp) {
>           int max_pmpcfg = (env->priv_ver >= PRIV_VERSION_1_12_0) ?
> -+                              CSR_PMPCFG15 : CSR_PMPCFG3;
> +                               CSR_PMPCFG15 : CSR_PMPCFG3;
>   
>           if (csrno <= max_pmpcfg) {
>               uint32_t reg_index = csrno - CSR_PMPCFG0;
> 
> ---
> base-commit: 0fc482b73d8e085d1375b4e17b0647fd2e6fe8f0
> change-id: 20251225-stray-d48679fda4a0
> 
> Best regards,
Re: [PATCH] target/riscv: Drop stray '+' in pmp()
Posted by Philippe Mathieu-Daudé 1 month ago
On 7/1/26 08:57, TANG Tiancheng wrote:
> Remove an unintended leading '+' left in target/riscv/csr.c (pmp()).
> 
> Fixes: cd633bea8b0
> Signed-off-by: TANG Tiancheng <lyndra@linux.alibaba.com>
> ---
> This patch fixes a stray '+' character that was accidentally introduced
> in the PMP (Physical Memory Protection) CSR handling code in target/riscv/csr.c.
> 
> The issue was introduced in commit cd633bea8b0 as part of the PMP region
> count configurable feature and causes a syntax error that prevents
> compilation.
> 
> Fixes: cd633bea8b0
> Link: https://lists.nongnu.org/archive/html/qemu-riscv/2025-06/msg00089.html
> ---
>   target/riscv/csr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>