drm/amd/display: Tidy up dm_drm_plane_reset()
authorTom St Denis <tom.stdenis@amd.com>
Tue, 17 Oct 2017 14:16:39 +0000 (10:16 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:53:36 +0000 (16:53 -0400)
Move WARN_ON higher up and in doing so fix brace style.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Andrey Grodzovsky <andey.grodzovsky@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index ce975aef27a7fbec1dba6c4851d7379ac46b2dbd..46fac2bccc574afd4ec148c1167449bae11d216a 100644 (file)
@@ -2873,13 +2873,13 @@ static void dm_drm_plane_reset(struct drm_plane *plane)
                plane->funcs->atomic_destroy_state(plane, plane->state);
 
        amdgpu_state = kzalloc(sizeof(*amdgpu_state), GFP_KERNEL);
-
+       WARN_ON(amdgpu_state == NULL);
+       
        if (amdgpu_state) {
                plane->state = &amdgpu_state->base;
                plane->state->plane = plane;
                plane->state->rotation = DRM_MODE_ROTATE_0;
-       } else
-               WARN_ON(1);
+       }
 }
 
 static struct drm_plane_state *