diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-12-06 13:10:34 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-01-11 15:46:55 +0100 |
commit | eae3eb3e185028d6e862db747e3b7397600d6762 (patch) | |
tree | 359a23639a6db7a77407cf8f366564561b970738 /include/qemu/queue.h | |
parent | 7274f01bb8b81ffe8f13f463b6b0f3b9246c5387 (diff) | |
download | qemu-eae3eb3e185028d6e862db747e3b7397600d6762.zip qemu-eae3eb3e185028d6e862db747e3b7397600d6762.tar.gz qemu-eae3eb3e185028d6e862db747e3b7397600d6762.tar.bz2 |
qemu/queue.h: simplify reverse access to QTAILQ
The new definition of QTAILQ does not require passing the headname,
remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/queue.h')
-rw-r--r-- | include/qemu/queue.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/qemu/queue.h b/include/qemu/queue.h index a893fac..1f8e219 100644 --- a/include/qemu/queue.h +++ b/include/qemu/queue.h @@ -432,14 +432,14 @@ union { \ (var) && ((next_var) = ((var)->field.tqe_next), 1); \ (var) = (next_var)) -#define QTAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = QTAILQ_LAST(head, headname); \ +#define QTAILQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = QTAILQ_LAST(head); \ (var); \ - (var) = QTAILQ_PREV(var, headname, field)) + (var) = QTAILQ_PREV(var, field)) -#define QTAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev_var) \ - for ((var) = QTAILQ_LAST(head, headname); \ - (var) && ((prev_var) = QTAILQ_PREV(var, headname, field)); \ +#define QTAILQ_FOREACH_REVERSE_SAFE(var, head, field, prev_var) \ + for ((var) = QTAILQ_LAST(head); \ + (var) && ((prev_var) = QTAILQ_PREV(var, field)); \ (var) = (prev_var)) /* @@ -452,9 +452,9 @@ union { \ #define QTAILQ_LINK_PREV(link) \ ((link).tql_prev->tql_prev->tql_next) -#define QTAILQ_LAST(head, headname) \ +#define QTAILQ_LAST(head) \ ((typeof((head)->tqh_first)) QTAILQ_LINK_PREV((head)->tqh_circ)) -#define QTAILQ_PREV(elm, headname, field) \ +#define QTAILQ_PREV(elm, field) \ ((typeof((elm)->field.tqe_next)) QTAILQ_LINK_PREV((elm)->field.tqe_circ)) #define field_at_offset(base, offset, type) \ |