drm/i915: pin: delete duplicate check in intel_pin_and_fence_fb_obj()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Nov 2021 11:48:50 +0000 (14:48 +0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 9 Nov 2021 22:59:27 +0000 (17:59 -0500)
The "ret" variable is checked on the previous line so we know it's
zero.  No need to check again.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211109114850.GB16587@kili
drivers/gpu/drm/i915/display/intel_fb_pin.c

index 3f77f3013584546522bde8eaae44cf98de55b475..3b20f69e0240192b3d24515f50b6dd119bd4a082 100644 (file)
@@ -142,13 +142,11 @@ retry:
        if (ret)
                goto err;
 
-       if (!ret) {
-               vma = i915_gem_object_pin_to_display_plane(obj, &ww, alignment,
-                                                          view, pinctl);
-               if (IS_ERR(vma)) {
-                       ret = PTR_ERR(vma);
-                       goto err_unpin;
-               }
+       vma = i915_gem_object_pin_to_display_plane(obj, &ww, alignment,
+                                                  view, pinctl);
+       if (IS_ERR(vma)) {
+               ret = PTR_ERR(vma);
+               goto err_unpin;
        }
 
        if (uses_fence && i915_vma_is_map_and_fenceable(vma)) {