drm/i915/perf: simplify configure all context function
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 13 Aug 2018 08:02:17 +0000 (09:02 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 31 Aug 2018 15:18:42 +0000 (16:18 +0100)
We don't need any special treatment on error so just return as soon as
possible.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180813080218.28994-2-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_perf.c

index 0376338d1f8d90978fd7674bcd9f0b22d7fff5d2..49597cf317072b462f678803d3d9040a95dca348 100644 (file)
@@ -1819,7 +1819,7 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
        /* Switch away from any user context. */
        ret = gen8_switch_to_updated_kernel_context(dev_priv, oa_config);
        if (ret)
-               goto out;
+               return ret;
 
        /*
         * The OA register config is setup through the context image. This image
@@ -1838,7 +1838,7 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
                                     wait_flags,
                                     MAX_SCHEDULE_TIMEOUT);
        if (ret)
-               goto out;
+               return ret;
 
        /* Update all contexts now that we've stalled the submission. */
        list_for_each_entry(ctx, &dev_priv->contexts.list, link) {
@@ -1850,10 +1850,8 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
                        continue;
 
                regs = i915_gem_object_pin_map(ce->state->obj, I915_MAP_WB);
-               if (IS_ERR(regs)) {
-                       ret = PTR_ERR(regs);
-                       goto out;
-               }
+               if (IS_ERR(regs))
+                       return PTR_ERR(regs);
 
                ce->state->obj->mm.dirty = true;
                regs += LRC_STATE_PN * PAGE_SIZE / sizeof(*regs);
@@ -1863,7 +1861,6 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
                i915_gem_object_unpin_map(ce->state->obj);
        }
 
- out:
        return ret;
 }