diff mbox series

[05/11] disas: Prefer cached CpuClass over CPU_GET_CLASS() macro

Message ID 20250121114056.53949-6-philmd@linaro.org
State New
Headers show
Series cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro | expand

Commit Message

Philippe Mathieu-Daudé Jan. 21, 2025, 11:40 a.m. UTC
CpuState caches its CPUClass since commit 6fbdff87062
("cpu: cache CPUClass in CPUState for hot code paths"),
use it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 disas/disas-common.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Richard Henderson Jan. 21, 2025, 3:57 p.m. UTC | #1
On 1/21/25 03:40, Philippe Mathieu-Daudé wrote:
> CpuState caches its CPUClass since commit 6fbdff87062
> ("cpu: cache CPUClass in CPUState for hot code paths"),
> use it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   disas/disas-common.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/disas/disas-common.c b/disas/disas-common.c
> index de61f6d8a12..57505823cb7 100644
> --- a/disas/disas-common.c
> +++ b/disas/disas-common.c
> @@ -67,9 +67,8 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu)
>           s->info.endian =  BFD_ENDIAN_LITTLE;
>       }
>   
> -    CPUClass *cc = CPU_GET_CLASS(cpu);
> -    if (cc->disas_set_info) {
> -        cc->disas_set_info(cpu, &s->info);
> +    if (cpu->cc->disas_set_info) {
> +        cpu->cc->disas_set_info(cpu, &s->info);
>       }
>   }
>   

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/disas/disas-common.c b/disas/disas-common.c
index de61f6d8a12..57505823cb7 100644
--- a/disas/disas-common.c
+++ b/disas/disas-common.c
@@ -67,9 +67,8 @@  void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu)
         s->info.endian =  BFD_ENDIAN_LITTLE;
     }
 
-    CPUClass *cc = CPU_GET_CLASS(cpu);
-    if (cc->disas_set_info) {
-        cc->disas_set_info(cpu, &s->info);
+    if (cpu->cc->disas_set_info) {
+        cpu->cc->disas_set_info(cpu, &s->info);
     }
 }