hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
commita3ad58342a9d88d1baafc0aee39302f79faad480
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 21 Jul 2020 13:05:51 +0000 (21 15:05 +0200)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 21 Jul 2020 14:47:31 +0000 (21 16:47 +0200)
tree2153c2d19eb541d458f6a55b34ccc0def4b4d9da
parent90218a9a393c7925f330e7dcc08658e2a01d3bd4
hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation

Document FWCfgDataGeneratorClass::get_data() return NULL
on error, and non-NULL on success. This allow us to simplify
fw_cfg_add_from_generator(). Since we don't need a local
variable to propagate the error, we can remove the ERRP_GUARD()
macro.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200721131911.27380-2-philmd@redhat.com>
hw/nvram/fw_cfg.c
include/hw/nvram/fw_cfg.h