diff mbox series

[v2,15/24] accel/tcg: Remove env_neg()

Message ID 20230914024435.1381329-16-richard.henderson@linaro.org
State Superseded
Headers show
Series Reduce usage of CPUArchState in cputlb.c | expand

Commit Message

Richard Henderson Sept. 14, 2023, 2:44 a.m. UTC
Replace the single use within env_tlb() and remove.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/exec/cpu-all.h | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Xingtao Yao (Fujitsu)" via Sept. 14, 2023, 10:39 a.m. UTC | #1
On 9/14/23 04:44, Richard Henderson wrote:
> Replace the single use within env_tlb() and remove.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/exec/cpu-all.h | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index 9db8544125..af9516654a 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -451,17 +451,6 @@ static inline CPUState *env_cpu(CPUArchState *env)
>       return (void *)env - sizeof(CPUState);
>   }
>   
> -/**
> - * env_neg(env)
> - * @env: The architecture environment
> - *
> - * Return the CPUNegativeOffsetState associated with the environment.
> - */
> -static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
> -{
> -    return (void *)env - sizeof(CPUNegativeOffsetState);
> -}
> -
>   /**
>    * env_tlb(env)
>    * @env: The architecture environment
> @@ -470,7 +459,7 @@ static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
>    */
>   static inline CPUTLB *env_tlb(CPUArchState *env)
>   {
> -    return &env_neg(env)->tlb;
> +    return &env_cpu(env)->neg.tlb;
>   }
>   
>   #endif /* CPU_ALL_H */
Reviewed-by: Anton Johansson <anjo@rev.ng>
diff mbox series

Patch

diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 9db8544125..af9516654a 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -451,17 +451,6 @@  static inline CPUState *env_cpu(CPUArchState *env)
     return (void *)env - sizeof(CPUState);
 }
 
-/**
- * env_neg(env)
- * @env: The architecture environment
- *
- * Return the CPUNegativeOffsetState associated with the environment.
- */
-static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
-{
-    return (void *)env - sizeof(CPUNegativeOffsetState);
-}
-
 /**
  * env_tlb(env)
  * @env: The architecture environment
@@ -470,7 +459,7 @@  static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
  */
 static inline CPUTLB *env_tlb(CPUArchState *env)
 {
-    return &env_neg(env)->tlb;
+    return &env_cpu(env)->neg.tlb;
 }
 
 #endif /* CPU_ALL_H */