drm/i915: Silence compiler warning

Silence the following -Wmaybe-uninitialized warnings and make the code
more clear.

drivers/gpu/drm/i915/intel_display.c: In function ‘__intel_set_mode’:
drivers/gpu/drm/i915/intel_display.c:11844:14: warning: ‘crtc_state’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  return state->mode_changed || state->active_changed;
              ^
drivers/gpu/drm/i915/intel_display.c:11854:25: note: ‘crtc_state’ was declared here
  struct drm_crtc_state *crtc_state;
                         ^
drivers/gpu/drm/i915/intel_display.c:11868:6: warning: ‘crtc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (crtc != intel_encoder->base.crtc)
      ^
drivers/gpu/drm/i915/intel_display.c:11853:19: note: ‘crtc’ was declared here
  struct drm_crtc *crtc;

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Ander Conselvan de Oliveira 2015-05-29 14:28:09 +03:00 committed by Daniel Vetter
parent 475c2e3b3c
commit bd4b4827ac

View File

@ -12045,15 +12045,15 @@ intel_modeset_update_state(struct drm_atomic_state *state)
if (!intel_encoder->base.crtc) if (!intel_encoder->base.crtc)
continue; continue;
for_each_crtc_in_state(state, crtc, crtc_state, i) for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (crtc == intel_encoder->base.crtc) if (crtc != intel_encoder->base.crtc)
break; continue;
if (crtc != intel_encoder->base.crtc) if (crtc_state->enable && needs_modeset(crtc_state))
continue; intel_encoder->connectors_active = false;
if (crtc_state->enable && needs_modeset(crtc_state)) break;
intel_encoder->connectors_active = false; }
} }
drm_atomic_helper_swap_state(state->dev, state); drm_atomic_helper_swap_state(state->dev, state);
@ -12068,24 +12068,24 @@ intel_modeset_update_state(struct drm_atomic_state *state)
if (!connector->encoder || !connector->encoder->crtc) if (!connector->encoder || !connector->encoder->crtc)
continue; continue;
for_each_crtc_in_state(state, crtc, crtc_state, i) for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (crtc == connector->encoder->crtc) if (crtc != connector->encoder->crtc)
break; continue;
if (crtc != connector->encoder->crtc) if (crtc->state->enable && needs_modeset(crtc->state)) {
continue; struct drm_property *dpms_property =
dev->mode_config.dpms_property;
if (crtc->state->enable && needs_modeset(crtc->state)) { connector->dpms = DRM_MODE_DPMS_ON;
struct drm_property *dpms_property = drm_object_property_set_value(&connector->base,
dev->mode_config.dpms_property; dpms_property,
DRM_MODE_DPMS_ON);
connector->dpms = DRM_MODE_DPMS_ON; intel_encoder = to_intel_encoder(connector->encoder);
drm_object_property_set_value(&connector->base, intel_encoder->connectors_active = true;
dpms_property, }
DRM_MODE_DPMS_ON);
intel_encoder = to_intel_encoder(connector->encoder); break;
intel_encoder->connectors_active = true;
} }
} }