blob: 76b358eab64919191fe4bbd96a9f1d3ab42de7a1 [file] [log] [blame]
From 21ed6373813736ade99edab76808d6c611757a08 Mon Sep 17 00:00:00 2001
From: Ben Widawsky <ben@bwidawsk.net>
Date: Wed, 31 Jul 2013 16:59:55 -0700
Subject: drm/i915: Rework drop caches for checkpatch
With an upcoming change to bind, to make checkpatch happy and keep the
code clean, we need to rework this code a bit.
This should have no functional impact.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Add the newline Chris requested.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 31a46c9c092afc6558e7be7eaa42eb9bd4d3de8b)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index eed2f4ca9a76..04debcedac2d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1784,12 +1784,14 @@ i915_drop_caches_set(void *data, u64 val)
if (val & DROP_BOUND) {
list_for_each_entry_safe(obj, next, &vm->inactive_list,
- mm_list)
- if (obj->pin_count == 0) {
- ret = i915_gem_object_unbind(obj);
- if (ret)
- goto unlock;
- }
+ mm_list) {
+ if (obj->pin_count)
+ continue;
+
+ ret = i915_gem_object_unbind(obj);
+ if (ret)
+ goto unlock;
+ }
}
if (val & DROP_UNBOUND) {
--
1.8.5.rc3