aboutsummaryrefslogtreecommitdiff
path: root/target/loongarch
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-29 17:44:46 +0100
committerThomas Huth <thuth@redhat.com>2024-03-12 11:46:16 +0100
commit94956d7b510d18f4449d1392b86e1a8f3e467612 (patch)
treea3366429557d71ed9a4a8b77a1a2d0ce540dacaa /target/loongarch
parent97e03106018301969f9e7c1eb22d3838adbe0bcc (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 'target/loongarch')
-rw-r--r--target/loongarch/tcg/translate.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c
index 58674cb268..7567712655 100644
--- a/target/loongarch/tcg/translate.c
+++ b/target/loongarch/tcg/translate.c
@@ -282,10 +282,9 @@ static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr)
static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
{
- CPULoongArchState *env = cpu_env(cs);
DisasContext *ctx = container_of(dcbase, DisasContext, base);
- ctx->opcode = translator_ldl(env, &ctx->base, ctx->base.pc_next);
+ ctx->opcode = translator_ldl(cpu_env(cs), &ctx->base, ctx->base.pc_next);
if (!decode(ctx, ctx->opcode)) {
qemu_log_mask(LOG_UNIMP, "Error: unknown opcode. "