Commit 9d8401fc authored by Dave Airlie's avatar Dave Airlie

drm/radeon: use list_for_each_entry instead of list_for_each

This is just a cleanup of the list macro usage.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1a029b76
...@@ -400,11 +400,9 @@ void radeon_object_list_add_object(struct radeon_object_list *lobj, ...@@ -400,11 +400,9 @@ void radeon_object_list_add_object(struct radeon_object_list *lobj,
int radeon_object_list_reserve(struct list_head *head) int radeon_object_list_reserve(struct list_head *head)
{ {
struct radeon_object_list *lobj; struct radeon_object_list *lobj;
struct list_head *i;
int r; int r;
list_for_each(i, head) { list_for_each_entry(lobj, head, list){
lobj = list_entry(i, struct radeon_object_list, list);
if (!lobj->robj->pin_count) { if (!lobj->robj->pin_count) {
r = radeon_object_reserve(lobj->robj, true); r = radeon_object_reserve(lobj->robj, true);
if (unlikely(r != 0)) { if (unlikely(r != 0)) {
...@@ -420,13 +418,10 @@ int radeon_object_list_reserve(struct list_head *head) ...@@ -420,13 +418,10 @@ int radeon_object_list_reserve(struct list_head *head)
void radeon_object_list_unreserve(struct list_head *head) void radeon_object_list_unreserve(struct list_head *head)
{ {
struct radeon_object_list *lobj; struct radeon_object_list *lobj;
struct list_head *i;
list_for_each(i, head) { list_for_each_entry(lobj, head, list) {
lobj = list_entry(i, struct radeon_object_list, list);
if (!lobj->robj->pin_count) { if (!lobj->robj->pin_count) {
radeon_object_unreserve(lobj->robj); radeon_object_unreserve(lobj->robj);
} else {
} }
} }
} }
...@@ -436,7 +431,6 @@ int radeon_object_list_validate(struct list_head *head, void *fence) ...@@ -436,7 +431,6 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
struct radeon_object_list *lobj; struct radeon_object_list *lobj;
struct radeon_object *robj; struct radeon_object *robj;
struct radeon_fence *old_fence = NULL; struct radeon_fence *old_fence = NULL;
struct list_head *i;
int r; int r;
r = radeon_object_list_reserve(head); r = radeon_object_list_reserve(head);
...@@ -444,8 +438,7 @@ int radeon_object_list_validate(struct list_head *head, void *fence) ...@@ -444,8 +438,7 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
radeon_object_list_unreserve(head); radeon_object_list_unreserve(head);
return r; return r;
} }
list_for_each(i, head) { list_for_each_entry(lobj, head, list) {
lobj = list_entry(i, struct radeon_object_list, list);
robj = lobj->robj; robj = lobj->robj;
if (!robj->pin_count) { if (!robj->pin_count) {
if (lobj->wdomain) { if (lobj->wdomain) {
...@@ -482,10 +475,8 @@ void radeon_object_list_unvalidate(struct list_head *head) ...@@ -482,10 +475,8 @@ void radeon_object_list_unvalidate(struct list_head *head)
{ {
struct radeon_object_list *lobj; struct radeon_object_list *lobj;
struct radeon_fence *old_fence = NULL; struct radeon_fence *old_fence = NULL;
struct list_head *i;
list_for_each(i, head) { list_for_each_entry(lobj, head, list) {
lobj = list_entry(i, struct radeon_object_list, list);
old_fence = (struct radeon_fence *)lobj->robj->tobj.sync_obj; old_fence = (struct radeon_fence *)lobj->robj->tobj.sync_obj;
lobj->robj->tobj.sync_obj = NULL; lobj->robj->tobj.sync_obj = NULL;
if (old_fence) { if (old_fence) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment