On 1/27/24 08:03, Philippe Mathieu-Daudé wrote:
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é<phi...@linaro.org>
---
  accel/tcg/cpu-exec.c             |  3 +--
  linux-user/i386/cpu_loop.c       |  4 ++--
  target/hppa/mem_helper.c         |  3 +--
  target/hppa/translate.c          |  3 +--
  target/i386/nvmm/nvmm-all.c      |  6 ++----
  target/i386/whpx/whpx-all.c      | 18 ++++++------------
  target/loongarch/tcg/translate.c |  3 +--
  target/rx/translate.c            |  3 +--
  target/sh4/op_helper.c           |  4 +---
  9 files changed, 16 insertions(+), 31 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to