diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-16 02:46:40 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-16 10:36:41 -0500 |
commit | b44f97fd78ce252c543674c46c45e67a1b0c5d90 (patch) | |
tree | 3fc34c20feb09b4b02841928cd0d9e6609e1562d | |
parent | 45b186f111f1623b257d183920cd4aab16a1acd5 (diff) |
drm/i915: Simplify i915_gtt_color_adjust()
If we remember that node_list is a circular list containing the fake
head_node, we can use a simple list_next_entry() and skip the NULL check
for the allocated check against the head_node.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161216074718.32500-3-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 8983b30d0e64..d49a04eb584a 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -2729,10 +2729,8 @@ static void i915_gtt_color_adjust(const struct drm_mm_node *node, | |||
2729 | if (node->color != color) | 2729 | if (node->color != color) |
2730 | *start += 4096; | 2730 | *start += 4096; |
2731 | 2731 | ||
2732 | node = list_first_entry_or_null(&node->node_list, | 2732 | node = list_next_entry(node, node_list); |
2733 | struct drm_mm_node, | 2733 | if (node->allocated && node->color != color) |
2734 | node_list); | ||
2735 | if (node && node->allocated && node->color != color) | ||
2736 | *end -= 4096; | 2734 | *end -= 4096; |
2737 | } | 2735 | } |
2738 | 2736 | ||