diff options
author | Andreas Färber <afaerber@suse.de> | 2013-05-10 16:34:06 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-09 21:20:28 +0200 |
commit | 6e42be7cd10260fd3a006d94f6c870692bf7a2c0 (patch) | |
tree | 75a590145a887c9d8424fd100d23e985ce2338ae /target-moxie/cpu.h | |
parent | 6291ad77d7c57dfc52a6a938d1a77ec3ec3ad16c (diff) | |
download | qemu-6e42be7cd10260fd3a006d94f6c870692bf7a2c0.tar.gz qemu-6e42be7cd10260fd3a006d94f6c870692bf7a2c0.tar.bz2 qemu-6e42be7cd10260fd3a006d94f6c870692bf7a2c0.zip |
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 3556c233d931ad5ffa46a35cb25cfc057732ebb8
(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>
Diffstat (limited to 'target-moxie/cpu.h')
-rw-r--r-- | target-moxie/cpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h index 374b24af52..72d02c20c1 100644 --- a/target-moxie/cpu.h +++ b/target-moxie/cpu.h @@ -106,7 +106,7 @@ typedef struct MoxieCPU { static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env) { - return MOXIE_CPU(container_of(env, MoxieCPU, env)); + return container_of(env, MoxieCPU, env); } #define ENV_GET_CPU(e) CPU(moxie_env_get_cpu(e)) |