summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/radeon_mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-core/radeon_mem.c b/shared-core/radeon_mem.c
index 7cecd7ee..01048a5a 100644
--- a/shared-core/radeon_mem.c
+++ b/shared-core/radeon_mem.c
@@ -86,7 +86,7 @@ static struct mem_block *alloc_block(struct mem_block *heap, int size,
struct mem_block *p;
int mask = (1 << align2) - 1;
- for (p = heap->next; p != heap; p = p->next) {
+ list_for_each(p, heap) {
int start = (p->start + mask) & ~mask;
if (p->filp == 0 && start + size <= p->start + p->size)
return split_block(p, start, size, filp);
@@ -99,7 +99,7 @@ static struct mem_block *find_block(struct mem_block *heap, int start)
{
struct mem_block *p;
- for (p = heap->next; p != heap; p = p->next)
+ list_for_each(p, heap)
if (p->start == start)
return p;
@@ -165,7 +165,7 @@ void radeon_mem_release(DRMFILE filp, struct mem_block *heap)
if (!heap || !heap->next)
return;
- for (p = heap->next; p != heap; p = p->next) {
+ list_for_each(p, heap) {
if (p->filp == filp)
p->filp = NULL;
}
@@ -173,7 +173,7 @@ void radeon_mem_release(DRMFILE filp, struct mem_block *heap)
/* Assumes a single contiguous range. Needs a special filp in
* 'heap' to stop it being subsumed.
*/
- for (p = heap->next; p != heap; p = p->next) {
+ list_for_each(p, heap) {
while (p->filp == 0 && p->next->filp == 0) {
struct mem_block *q = p->next;
p->size += q->size;