From 6e42be7cd10260fd3a006d94f6c870692bf7a2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 10 May 2013 16:34:06 +0200 Subject: cpu: Drop unnecessary dynamic casts in *_env_get_cpu() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A transition from CPUFooState to FooCPU can be considered safe, just like FooCPU::env access in the opposite direction. The only benefit of the FOO_CPU() casts would be protection against bogus CPUFooState pointers, but then surrounding code would likely break, too. This should slightly improve interrupt etc. performance when going from CPUFooState to FooCPU. For any additional CPU() casts see 3556c233d931ad5ffa46a35cb25cfc057732ebb8 (qom: allow turning cast debugging off). Reported-by: Anthony Liguori Acked-by: Richard Henderson Signed-off-by: Andreas Färber --- target-microblaze/cpu-qom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target-microblaze') diff --git a/target-microblaze/cpu-qom.h b/target-microblaze/cpu-qom.h index 3e9c20668f..ec2b989a23 100644 --- a/target-microblaze/cpu-qom.h +++ b/target-microblaze/cpu-qom.h @@ -64,7 +64,7 @@ typedef struct MicroBlazeCPU { static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env) { - return MICROBLAZE_CPU(container_of(env, MicroBlazeCPU, env)); + return container_of(env, MicroBlazeCPU, env); } #define ENV_GET_CPU(e) CPU(mb_env_get_cpu(e)) -- cgit v1.2.3