aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-11-20 11:29:31 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-05 16:20:15 +0100
commitb9159451d3411bfef528f431c98527c172cd46e8 (patch)
tree03ca4babad40185e2de6ce300fa866c2568da6a5 /system
parentfe5f33d6b086d6911d69dd77abe09b21bdb2ea5f (diff)
downloadqemu-b9159451d3411bfef528f431c98527c172cd46e8.zip
qemu-b9159451d3411bfef528f431c98527c172cd46e8.tar.gz
qemu-b9159451d3411bfef528f431c98527c172cd46e8.tar.bz2
memory: Have memory_region_init_rom() handler return a boolean
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have memory_region_init_rom() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Gavin Shan <gshan@redhat.com> Message-Id: <20231120213301.24349-8-philmd@linaro.org>
Diffstat (limited to 'system')
-rw-r--r--system/memory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/memory.c b/system/memory.c
index 45ce6fd..069aa5e 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -3593,7 +3593,7 @@ bool memory_region_init_ram(MemoryRegion *mr,
return true;
}
-void memory_region_init_rom(MemoryRegion *mr,
+bool memory_region_init_rom(MemoryRegion *mr,
Object *owner,
const char *name,
uint64_t size,
@@ -3602,7 +3602,7 @@ void memory_region_init_rom(MemoryRegion *mr,
DeviceState *owner_dev;
if (!memory_region_init_rom_nomigrate(mr, owner, name, size, errp)) {
- return;
+ return false;
}
/* This will assert if owner is neither NULL nor a DeviceState.
* We only want the owner here for the purposes of defining a
@@ -3612,6 +3612,8 @@ void memory_region_init_rom(MemoryRegion *mr,
*/
owner_dev = DEVICE(owner);
vmstate_register_ram(mr, owner_dev);
+
+ return true;
}
void memory_region_init_rom_device(MemoryRegion *mr,