drm/i915: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
authorWan Jiabing <wanjiabing@vivo.com>
Mon, 25 Oct 2021 11:32:50 +0000 (07:32 -0400)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 25 Oct 2021 15:35:55 +0000 (16:35 +0100)
Fix following coccicheck warning:
./drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:3117:15-22: WARNING:
ERR_CAST can be used with eb->requests[i].

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211025113316.24424-1-wanjiabing@vivo.com
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

index 4d7da07442f2a274620bf2b7bd4915e524918f25..eb2dcaf78d085ed1961c602f671a8ad8b0d07769 100644 (file)
@@ -3114,7 +3114,7 @@ eb_requests_create(struct i915_execbuffer *eb, struct dma_fence *in_fence,
                /* Allocate a request for this batch buffer nice and early. */
                eb->requests[i] = i915_request_create(eb_find_context(eb, i));
                if (IS_ERR(eb->requests[i])) {
-                       out_fence = ERR_PTR(PTR_ERR(eb->requests[i]));
+                       out_fence = ERR_CAST(eb->requests[i]);
                        eb->requests[i] = NULL;
                        return out_fence;
                }