mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 00:06:36 +00:00
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
This commit is contained in:
parent
45b186f111
commit
b44f97fd78
1 changed files with 2 additions and 4 deletions
|
@ -2729,10 +2729,8 @@ static void i915_gtt_color_adjust(const struct drm_mm_node *node,
|
|||
if (node->color != color)
|
||||
*start += 4096;
|
||||
|
||||
node = list_first_entry_or_null(&node->node_list,
|
||||
struct drm_mm_node,
|
||||
node_list);
|
||||
if (node && node->allocated && node->color != color)
|
||||
node = list_next_entry(node, node_list);
|
||||
if (node->allocated && node->color != color)
|
||||
*end -= 4096;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue