mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
cpu: Drop unnecessary dynamic casts in *_env_get_cpu()
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 3556c233d9
(qom: allow turning cast debugging off).
Reported-by: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
6291ad77d7
commit
6e42be7cd1
16 changed files with 16 additions and 16 deletions
|
@ -64,7 +64,7 @@ typedef struct LM32CPU {
|
|||
|
||||
static inline LM32CPU *lm32_env_get_cpu(CPULM32State *env)
|
||||
{
|
||||
return LM32_CPU(container_of(env, LM32CPU, env));
|
||||
return container_of(env, LM32CPU, env);
|
||||
}
|
||||
|
||||
#define ENV_GET_CPU(e) CPU(lm32_env_get_cpu(e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue