diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-29 17:44:46 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-03-12 11:46:16 +0100 |
commit | 94956d7b510d18f4449d1392b86e1a8f3e467612 (patch) | |
tree | a3366429557d71ed9a4a8b77a1a2d0ce540dacaa /linux-user/i386 | |
parent | 97e03106018301969f9e7c1eb22d3838adbe0bcc (diff) |
bulk: Call in place single use cpu_env()
Avoid CPUArchState local variable when cpu_env() is used once.
Mechanical patch using the following Coccinelle spatch script:
@@
type CPUArchState;
identifier env;
expression cs;
@@
{
- CPUArchState *env = cpu_env(cs);
... when != env
- env
+ cpu_env(cs)
... when != env
}
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-5-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'linux-user/i386')
-rw-r--r-- | linux-user/i386/cpu_loop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 42ecb4bf0a..92beb6830c 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -323,8 +323,8 @@ void cpu_loop(CPUX86State *env) static void target_cpu_free(void *obj) { - CPUArchState *env = cpu_env(obj); - target_munmap(env->gdt.base, sizeof(uint64_t) * TARGET_GDT_ENTRIES); + target_munmap(cpu_env(obj)->gdt.base, + sizeof(uint64_t) * TARGET_GDT_ENTRIES); g_free(obj); } |