Commit bd4b4827 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Suggested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 475c2e3b
...@@ -12045,15 +12045,15 @@ intel_modeset_update_state(struct drm_atomic_state *state) ...@@ -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)
break;
if (crtc != intel_encoder->base.crtc) if (crtc != intel_encoder->base.crtc)
continue; continue;
if (crtc_state->enable && needs_modeset(crtc_state)) if (crtc_state->enable && needs_modeset(crtc_state))
intel_encoder->connectors_active = false; intel_encoder->connectors_active = false;
break;
}
} }
drm_atomic_helper_swap_state(state->dev, state); drm_atomic_helper_swap_state(state->dev, state);
...@@ -12068,10 +12068,7 @@ intel_modeset_update_state(struct drm_atomic_state *state) ...@@ -12068,10 +12068,7 @@ 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)
break;
if (crtc != connector->encoder->crtc) if (crtc != connector->encoder->crtc)
continue; continue;
...@@ -12087,6 +12084,9 @@ intel_modeset_update_state(struct drm_atomic_state *state) ...@@ -12087,6 +12084,9 @@ intel_modeset_update_state(struct drm_atomic_state *state)
intel_encoder = to_intel_encoder(connector->encoder); intel_encoder = to_intel_encoder(connector->encoder);
intel_encoder->connectors_active = true; intel_encoder->connectors_active = true;
} }
break;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment