summary refs log tree commit diff stats
path: root/contrib/elf2dmp/addrspace.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-03-07 19:20:48 +0900
committerPeter Maydell <peter.maydell@linaro.org>2024-03-11 17:06:06 +0000
commita15f9749490e8d813b8929c69a7365e3edc6ab8c (patch)
tree4e6ec10afdf1275dabb99aa486a1d4a6b1785431 /contrib/elf2dmp/addrspace.c
parent262a0ff88029e86b29434d4b2e7f710ae73b646c (diff)
downloadfocaccia-qemu-a15f9749490e8d813b8929c69a7365e3edc6ab8c.tar.gz
focaccia-qemu-a15f9749490e8d813b8929c69a7365e3edc6ab8c.zip
contrib/elf2dmp: Fix error reporting style in addrspace.c
include/qapi/error.h says:
> We recommend
> * bool-valued functions return true on success / false on failure,
> ...

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240307-elf2dmp-v4-5-4f324ad4d99d@daynix.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'contrib/elf2dmp/addrspace.c')
-rw-r--r--contrib/elf2dmp/addrspace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c
index 4c127c9b1e..c995c723ae 100644
--- a/contrib/elf2dmp/addrspace.c
+++ b/contrib/elf2dmp/addrspace.c
@@ -226,8 +226,8 @@ void *va_space_resolve(struct va_space *vs, uint64_t va)
     return pa_space_resolve(vs->ps, pa);
 }
 
-int va_space_rw(struct va_space *vs, uint64_t addr,
-        void *buf, size_t size, int is_write)
+bool va_space_rw(struct va_space *vs, uint64_t addr,
+                 void *buf, size_t size, int is_write)
 {
     while (size) {
         uint64_t page = addr & ELF2DMP_PFN_MASK;
@@ -238,7 +238,7 @@ int va_space_rw(struct va_space *vs, uint64_t addr,
 
         ptr = va_space_resolve(vs, addr);
         if (!ptr) {
-            return 1;
+            return false;
         }
 
         if (is_write) {
@@ -252,5 +252,5 @@ int va_space_rw(struct va_space *vs, uint64_t addr,
         addr += s;
     }
 
-    return 0;
+    return true;
 }