drm/i915: Remove check for !crtc_state in intel_plane_atomic_calc_changes()
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 2 Jul 2016 14:36:06 +0000 (15:36 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 2 Jul 2016 18:20:17 +0000 (19:20 +0100)
smatch spotted that:

drivers/gpu/drm/i915/intel_display.c:11986
intel_plane_atomic_calc_changes() warn: variable dereferenced before
check 'crtc_state' (see line 11972)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1467470166-31717-9-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
drivers/gpu/drm/i915/intel_display.c

index 88e899b468531efab5f6bfa17a5bd4e82779c8fe..32db694a4dc5623a2a017f93fec1ca8da0dd6adb 100644 (file)
@@ -11983,8 +11983,7 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
        struct drm_framebuffer *fb = plane_state->fb;
        int ret;
 
-       if (crtc_state && INTEL_INFO(dev)->gen >= 9 &&
-           plane->type != DRM_PLANE_TYPE_CURSOR) {
+       if (INTEL_GEN(dev) >= 9 && plane->type != DRM_PLANE_TYPE_CURSOR) {
                ret = skl_update_scaler_plane(
                        to_intel_crtc_state(crtc_state),
                        to_intel_plane_state(plane_state));