[PATCH] target/riscv: Remove redundant macro definitions

wang.yechao255@zte.com.cn posted 1 patch 1 month ago
Failed in applying to current master (apply log)
target/riscv/cpu.h | 2 --
1 file changed, 2 deletions(-)
[PATCH] target/riscv: Remove redundant macro definitions
Posted by wang.yechao255@zte.com.cn 1 month ago
From: yechao-w <wang.yechao255@zte.com.cn>

The macro MMU_USER_IDX is unused, and its defined value is incorrect.
It should be MMUIdx_U(0), which is defined in target/riscv/internals.h.
Therefore, remove the macro definition of MMU_USER_IDX.

Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
---
 target/riscv/cpu.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 90b3e95105..e3899b49ef 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -172,8 +172,6 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];
 
 #define RISCV_IMPLIED_EXTS_RULE_END -1
 
-#define MMU_USER_IDX 3
-
 #define MAX_RISCV_PMPS (64)
 #define OLD_MAX_RISCV_PMPS (16)
 #define MIN_RISCV_PMP_GRANULARITY 4
-- 
2.27.0
Re: [PATCH] target/riscv: Remove redundant macro definitions
Posted by Daniel Henrique Barboza 1 month ago

On 1/7/26 5:13 AM, wang.yechao255@zte.com.cn wrote:
> From: yechao-w <wang.yechao255@zte.com.cn>
> 
> 
> The macro MMU_USER_IDX is unused, and its defined value is incorrect.
> 
> It should be MMUIdx_U(0), which is defined in target/riscv/internals.h.
> 
> Therefore, remove the macro definition of MMU_USER_IDX.
> 
> 
> Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
> 
> ---

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

> 
>   target/riscv/cpu.h | 2 --
> 
>   1 file changed, 2 deletions(-)
> 
> 
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> 
> index 90b3e95105..e3899b49ef 100644
> 
> --- a/target/riscv/cpu.h
> 
> +++ b/target/riscv/cpu.h
> 
> @@ -172,8 +172,6 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];
> 
>   #define RISCV_IMPLIED_EXTS_RULE_END -1
> 
> -#define MMU_USER_IDX 3
> 
> -
> 
>   #define MAX_RISCV_PMPS (64)
> 
>   #define OLD_MAX_RISCV_PMPS (16)
> 
>   #define MIN_RISCV_PMP_GRANULARITY 4
> 
> -- 
> 
> 2.27.0
> 
> 
> 
> 
>