drm/i915: Prefer list_first_entry_or_null
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 26 Jul 2016 11:01:51 +0000 (12:01 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 26 Jul 2016 12:00:58 +0000 (13:00 +0100)
commit2a1d775201081c400d7e60ceb8e5ac887d11b1f7
tree5bd3ef0d28b31918b4325c4f74459855ba2f2095
parent4a50d20e105a4a8e46a641e4779e9431e0aabc84
drm/i915: Prefer list_first_entry_or_null

list_first_entry_or_null() can generate better code than using
if (!list_empty()) {ptr = list_first_entry()) ..., so put it to use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1469432687-22756-3-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1469530913-17180-2-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/i915_gem_shrinker.c