Philippe Mathieu-Daudé <[email protected]> writes: > On 5/11/25 12:44, Gavin Shan wrote: >> Use error_abort in acpi_ghes_memory_errors() so that the caller needn't >> explicitly call abort() on errors. With this change, its return value >> isn't needed any more. >> Suggested-by: Igor Mammedov <[email protected]> >> Signed-off-by: Gavin Shan <[email protected]> >> --- >> hw/acpi/ghes-stub.c | 6 +++--- >> hw/acpi/ghes.c | 15 ++++----------- >> include/hw/acpi/ghes.h | 5 +++-- >> target/arm/kvm.c | 10 +++------- >> 4 files changed, 13 insertions(+), 23 deletions(-) > > >> diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h >> index f73908985d..35c7bbbb01 100644 >> --- a/include/hw/acpi/ghes.h >> +++ b/include/hw/acpi/ghes.h >> @@ -98,8 +98,9 @@ void acpi_build_hest(AcpiGhesState *ags, GArray >> *table_data, >> const char *oem_id, const char *oem_table_id); >> void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s, >> GArray *hardware_errors); >> -int acpi_ghes_memory_errors(AcpiGhesState *ags, uint16_t source_id, >> - uint64_t *addresses, uint32_t num_of_addresses); >> +void acpi_ghes_memory_errors(AcpiGhesState *ags, uint16_t source_id, >> + uint64_t *addresses, uint32_t num_of_addresses, >> + Error **errp); > > This is an anti-pattern w.r.t. commit e3fe3988d78 ("error: Document > Error API usage rules"), because it can be called with an errp distinct > of &error_abort. > > If you really want to abort(), remove the errp argument, directly call > abort() and rename as acpi_ghes_memory_abort_on_errors().
Since there are no callers that do not want abort() on error, this is fine. I think your patch is also fine in princple, but a few details are wrong. I'll point them out inline. [...]
