diff mbox series

[4/7] cpus: Constify cpu_get_address_space() 'cpu' argument

Message ID 20250120061310.81368-5-philmd@linaro.org (mailing list archive)
State New
Headers show
Series cpus: Constify some CPUState arguments | expand

Commit Message

Philippe Mathieu-Daudé Jan. 20, 2025, 6:13 a.m. UTC
CPUState structure is not modified, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/core/cpu.h | 2 +-
 system/physmem.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 782c43ac8b3..04fede0e69a 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -1155,7 +1155,7 @@  void cpu_watchpoint_remove_all(CPUState *cpu, int mask);
  * Return the requested address space of this CPU. @asidx
  * specifies which address space to read.
  */
-AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
+AddressSpace *cpu_get_address_space(const CPUState *cpu, int asidx);
 
 G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...)
     G_GNUC_PRINTF(2, 3);
diff --git a/system/physmem.c b/system/physmem.c
index c76503aea82..0ac6acb9764 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -805,7 +805,7 @@  void cpu_address_space_destroy(CPUState *cpu, int asidx)
     }
 }
 
-AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx)
+AddressSpace *cpu_get_address_space(const CPUState *cpu, int asidx)
 {
     /* Return the AddressSpace corresponding to the specified index */
     return cpu->cpu_ases[asidx].as;