mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
pan/midgard: use macros for mir_prev_op / mir_next_op
The benefit of macros here is that they don't care about constness, which is going to be benefitial once we stricten constness a bit here. Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32851>
This commit is contained in:
parent
a3871da932
commit
430f7e991f
1 changed files with 4 additions and 10 deletions
|
|
@ -347,17 +347,11 @@ mir_remove_instruction(struct midgard_instruction *ins)
|
|||
list_del(&ins->link);
|
||||
}
|
||||
|
||||
static inline midgard_instruction *
|
||||
mir_prev_op(struct midgard_instruction *ins)
|
||||
{
|
||||
return list_last_entry(&(ins->link), midgard_instruction, link);
|
||||
}
|
||||
#define mir_prev_op(ins) \
|
||||
list_last_entry(&((ins)->link), midgard_instruction, link)
|
||||
|
||||
static inline midgard_instruction *
|
||||
mir_next_op(struct midgard_instruction *ins)
|
||||
{
|
||||
return list_first_entry(&(ins->link), midgard_instruction, link);
|
||||
}
|
||||
#define mir_next_op(ins) \
|
||||
list_first_entry(&((ins)->link), midgard_instruction, link)
|
||||
|
||||
#define mir_foreach_block(ctx, v) \
|
||||
list_for_each_entry(pan_block, v, &ctx->blocks, link)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue