]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/vc4: simplify the return expression of vc4_prepare_fb()
authorMinghao Chi <chi.minghao@zte.com.cn>
Fri, 29 Apr 2022 05:49:45 +0000 (05:49 +0000)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 29 Apr 2022 14:26:56 +0000 (16:26 +0200)
Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429054945.3852039-1-chi.minghao@zte.com.cn
drivers/gpu/drm/vc4/vc4_plane.c

index 920a9eefe426148219799383fed4168cd02285cd..b3438f4a81ced696556c33048e6025e7f54a50d2 100644 (file)
@@ -1350,7 +1350,6 @@ static int vc4_prepare_fb(struct drm_plane *plane,
                          struct drm_plane_state *state)
 {
        struct vc4_bo *bo;
-       int ret;
 
        if (!state->fb)
                return 0;
@@ -1362,11 +1361,7 @@ static int vc4_prepare_fb(struct drm_plane *plane,
        if (plane->state->fb == state->fb)
                return 0;
 
-       ret = vc4_bo_inc_usecnt(bo);
-       if (ret)
-               return ret;
-
-       return 0;
+       return vc4_bo_inc_usecnt(bo);
 }
 
 static void vc4_cleanup_fb(struct drm_plane *plane,