]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Do not rely on for loop caching the mask
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 25 Jul 2019 12:50:56 +0000 (13:50 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 26 Jul 2019 16:14:06 +0000 (17:14 +0100)
for_each_engine_masked caches the engine mask but what does the caller
know.

Cache it explicitly for clarity and while at it correct the type to match.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190725125056.11942-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_active.c

index 22341c62c2043619bb5ffb0792976ad5b25f7fe5..d32db8a4db5cb9a91c9c812e29671b214d5c226d 100644 (file)
@@ -378,12 +378,12 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref,
                                            struct intel_engine_cs *engine)
 {
        struct drm_i915_private *i915 = engine->i915;
+       intel_engine_mask_t tmp, mask = engine->mask;
        struct llist_node *pos, *next;
-       unsigned long tmp;
        int err;
 
-       GEM_BUG_ON(!engine->mask);
-       for_each_engine_masked(engine, i915, engine->mask, tmp) {
+       GEM_BUG_ON(!mask);
+       for_each_engine_masked(engine, i915, mask, tmp) {
                struct intel_context *kctx = engine->kernel_context;
                struct active_node *node;