mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00: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:
committed by
Markus Armbruster
parent
dc13f40c6b
commit
c3033fd372
12
iothread.c
12
iothread.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Event loop thread
|
||||
*
|
||||
* Copyright Red Hat Inc., 2013
|
||||
* Copyright Red Hat Inc., 2013, 2020
|
||||
*
|
||||
* Authors:
|
||||
* Stefan Hajnoczi <stefanha@redhat.com>
|
||||
@ -310,8 +310,7 @@ AioContext *iothread_get_aio_context(IOThread *iothread)
|
||||
|
||||
static int query_one_iothread(Object *object, void *opaque)
|
||||
{
|
||||
IOThreadInfoList ***prev = opaque;
|
||||
IOThreadInfoList *elem;
|
||||
IOThreadInfoList ***tail = opaque;
|
||||
IOThreadInfo *info;
|
||||
IOThread *iothread;
|
||||
|
||||
@ -327,12 +326,7 @@ static int query_one_iothread(Object *object, void *opaque)
|
||||
info->poll_grow = iothread->poll_grow;
|
||||
info->poll_shrink = iothread->poll_shrink;
|
||||
|
||||
elem = g_new0(IOThreadInfoList, 1);
|
||||
elem->value = info;
|
||||
elem->next = NULL;
|
||||
|
||||
**prev = elem;
|
||||
*prev = &elem->next;
|
||||
QAPI_LIST_APPEND(*tail, info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user