summary refs log tree commit diff stats
path: root/target/avr/gdbstub.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-29 17:44:51 +0100
committerThomas Huth <thuth@redhat.com>2024-03-12 11:46:17 +0100
commit2db5b94d8343816e99527cf99cf14d090d174ef6 (patch)
treea2217dde707aedfc38c65310acdf8a51e71cb67b /target/avr/gdbstub.c
parent50cb36ce77906c24dd6f587c636d3d71dd6128f4 (diff)
downloadfocaccia-qemu-2db5b94d8343816e99527cf99cf14d090d174ef6.tar.gz
focaccia-qemu-2db5b94d8343816e99527cf99cf14d090d174ef6.zip
target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro
Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-10-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'target/avr/gdbstub.c')
-rw-r--r--target/avr/gdbstub.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/target/avr/gdbstub.c b/target/avr/gdbstub.c
index 150344d8b9..2eeee2bf4e 100644
--- a/target/avr/gdbstub.c
+++ b/target/avr/gdbstub.c
@@ -23,8 +23,7 @@
 
 int avr_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
 {
-    AVRCPU *cpu = AVR_CPU(cs);
-    CPUAVRState *env = &cpu->env;
+    CPUAVRState *env = cpu_env(cs);
 
     /*  R */
     if (n < 32) {
@@ -53,8 +52,7 @@ int avr_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
 
 int avr_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
-    AVRCPU *cpu = AVR_CPU(cs);
-    CPUAVRState *env = &cpu->env;
+    CPUAVRState *env = cpu_env(cs);
 
     /*  R */
     if (n < 32) {