Commit 2927e421 authored by Chris Wilson's avatar Chris Wilson

drm/i915/crt: Silence compiler warning for uninitialised status

clang is confused by our if-else-chain that abruptly exits before a
final else:

drivers/gpu/drm/i915/intel_crt.c:821:11: warning: variable 'status' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (ret < 0)
                 ^~~~~~~
drivers/gpu/drm/i915/intel_crt.c:826:9: note: uninitialized use occurs here
        return status;
               ^~~~~~
drivers/gpu/drm/i915/intel_crt.c:821:7: note: remove the 'if' if its condition is always true
        else if (ret < 0)
             ^~~~~~~~~~~~
drivers/gpu/drm/i915/intel_crt.c:761:12: note: initialize the variable 'status' to silence this warning
        int status, ret;

In this case, we can reduce the final else-if clause to an unconditional
else.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180208163939.27030-1-chris@chris-wilson.co.uk
parent f0fa739a
...@@ -810,10 +810,11 @@ intel_crt_detect(struct drm_connector *connector, ...@@ -810,10 +810,11 @@ intel_crt_detect(struct drm_connector *connector,
else else
status = connector_status_unknown; status = connector_status_unknown;
intel_release_load_detect_pipe(connector, &tmp, ctx); intel_release_load_detect_pipe(connector, &tmp, ctx);
} else if (ret == 0) } else if (ret == 0) {
status = connector_status_unknown; status = connector_status_unknown;
else if (ret < 0) } else {
status = ret; status = ret;
}
out: out:
intel_display_power_put(dev_priv, intel_encoder->power_domain); intel_display_power_put(dev_priv, intel_encoder->power_domain);
......
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