diff mbox series

[01/17] hw/core/cpu: Use size_t for memory_rw_debug len argument

Message ID 20250323173730.3213964-2-richard.henderson@linaro.org
State Superseded
Headers show
Series target/avr: Increase page size | expand

Commit Message

Richard Henderson March 23, 2025, 5:37 p.m. UTC
Match the prototype of cpu_memory_rw_debug().

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/hw/core/cpu.h     | 2 +-
 target/sparc/cpu.h        | 2 +-
 target/sparc/mmu_helper.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé March 23, 2025, 9:25 p.m. UTC | #1
On 23/3/25 18:37, Richard Henderson wrote:
> Match the prototype of cpu_memory_rw_debug().
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/hw/core/cpu.h     | 2 +-
>   target/sparc/cpu.h        | 2 +-
>   target/sparc/mmu_helper.c | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Pierrick Bouvier March 25, 2025, 12:43 a.m. UTC | #2
On 3/23/25 10:37, Richard Henderson wrote:
> Match the prototype of cpu_memory_rw_debug().
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/hw/core/cpu.h     | 2 +-
>   target/sparc/cpu.h        | 2 +-
>   target/sparc/mmu_helper.c | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index 5d11d26556..abd8764e83 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -154,7 +154,7 @@ struct CPUClass {
>   
>       int (*mmu_index)(CPUState *cpu, bool ifetch);
>       int (*memory_rw_debug)(CPUState *cpu, vaddr addr,
> -                           uint8_t *buf, int len, bool is_write);
> +                           uint8_t *buf, size_t len, bool is_write);
>       void (*dump_state)(CPUState *cpu, FILE *, int flags);
>       void (*query_cpu_fast)(CPUState *cpu, CpuInfoFast *value);
>       int64_t (*get_arch_id)(CPUState *cpu);
> diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
> index 462bcb6c0e..68f8c21e7c 100644
> --- a/target/sparc/cpu.h
> +++ b/target/sparc/cpu.h
> @@ -604,7 +604,7 @@ void dump_mmu(CPUSPARCState *env);
>   
>   #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY)
>   int sparc_cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
> -                              uint8_t *buf, int len, bool is_write);
> +                              uint8_t *buf, size_t len, bool is_write);
>   #endif
>   
>   /* translate.c */
> diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
> index 7548d01777..3821cd91ec 100644
> --- a/target/sparc/mmu_helper.c
> +++ b/target/sparc/mmu_helper.c
> @@ -389,7 +389,7 @@ void dump_mmu(CPUSPARCState *env)
>    * that the sparc ABI is followed.
>    */
>   int sparc_cpu_memory_rw_debug(CPUState *cs, vaddr address,
> -                              uint8_t *buf, int len, bool is_write)
> +                              uint8_t *buf, size_t len, bool is_write)
>   {
>       CPUSPARCState *env = cpu_env(cs);
>       target_ulong addr = address;

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5d11d26556..abd8764e83 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -154,7 +154,7 @@  struct CPUClass {
 
     int (*mmu_index)(CPUState *cpu, bool ifetch);
     int (*memory_rw_debug)(CPUState *cpu, vaddr addr,
-                           uint8_t *buf, int len, bool is_write);
+                           uint8_t *buf, size_t len, bool is_write);
     void (*dump_state)(CPUState *cpu, FILE *, int flags);
     void (*query_cpu_fast)(CPUState *cpu, CpuInfoFast *value);
     int64_t (*get_arch_id)(CPUState *cpu);
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 462bcb6c0e..68f8c21e7c 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -604,7 +604,7 @@  void dump_mmu(CPUSPARCState *env);
 
 #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY)
 int sparc_cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
-                              uint8_t *buf, int len, bool is_write);
+                              uint8_t *buf, size_t len, bool is_write);
 #endif
 
 /* translate.c */
diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index 7548d01777..3821cd91ec 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -389,7 +389,7 @@  void dump_mmu(CPUSPARCState *env)
  * that the sparc ABI is followed.
  */
 int sparc_cpu_memory_rw_debug(CPUState *cs, vaddr address,
-                              uint8_t *buf, int len, bool is_write)
+                              uint8_t *buf, size_t len, bool is_write)
 {
     CPUSPARCState *env = cpu_env(cs);
     target_ulong addr = address;