diff options
author | Markus Armbruster <armbru@redhat.com> | 2022-11-21 09:50:47 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2022-12-14 16:19:35 +0100 |
commit | 05e385d2a96325c1f26b874f1b832237229b8c1f (patch) | |
tree | 3e17519074c633ebc1f2875b215677788e52e4ab /hw/core | |
parent | 740d6c4eba8bb44ea00550ccc97a4c49945ecc3c (diff) |
error: Move ERRP_GUARD() to the beginning of the function
include/qapi/error.h advises to put ERRP_GUARD() right at the
beginning of the function, because only then can it guard the whole
function. Clean up the few spots disregarding the advice.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221121085054.683122-4-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/machine.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c index 8d34caa31d..2352861240 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -554,12 +554,11 @@ static void machine_get_mem(Object *obj, Visitor *v, const char *name, static void machine_set_mem(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { + ERRP_GUARD(); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); MemorySizeConfiguration *mem; - ERRP_GUARD(); - if (!visit_type_MemorySizeConfiguration(v, name, &mem, errp)) { return; } |