mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
qapi: Use QAPI_LIST_APPEND in trivial cases
The easiest spots to use QAPI_LIST_APPEND are where we already have an obvious pointer to the tail of a list. While at it, consistently use the variable name 'tail' for that purpose. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210113221013.390592-5-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
dc13f40c6b
commit
c3033fd372
20 changed files with 96 additions and 222 deletions
|
@ -44,14 +44,11 @@ static ACPIOSTInfo *acpi_cpu_device_status(int idx, AcpiCpuStatus *cdev)
|
|||
|
||||
void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list)
|
||||
{
|
||||
ACPIOSTInfoList ***tail = list;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < cpu_st->dev_count; i++) {
|
||||
ACPIOSTInfoList *elem = g_new0(ACPIOSTInfoList, 1);
|
||||
elem->value = acpi_cpu_device_status(i, &cpu_st->devs[i]);
|
||||
elem->next = NULL;
|
||||
**list = elem;
|
||||
*list = &elem->next;
|
||||
QAPI_LIST_APPEND(*tail, acpi_cpu_device_status(i, &cpu_st->devs[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue