[Intel-gfx] [PATCH 2/2] drm/i915/display: Mark conn as initialised by iterator

Mika Kuoppala mika.kuoppala at linux.intel.com
Mon Oct 28 14:55:37 UTC 2019


Chris Wilson <chris at chris-wilson.co.uk> writes:

> smatch complains about
> drivers/gpu/drm/i915//display/intel_display.c:14403 intel_set_dp_tp_ctl_normal() error: uninitialized symbol 'conn'.
> because it has no way to determine that the loop must have an entry.
> Tell the static analysers to ignore the local, it will always be set.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 0f0c582a56d5..9dce2e9e5376 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -14391,8 +14391,8 @@ static void intel_crtc_enable_trans_port_sync(struct intel_crtc *crtc,
>  static void intel_set_dp_tp_ctl_normal(struct intel_crtc *crtc,
>  				       struct intel_atomic_state *state)
>  {
> +	struct drm_connector *uninitialized_var(conn);
>  	struct drm_connector_state *conn_state;
> -	struct drm_connector *conn;
>  	struct intel_dp *intel_dp;
>  	int i;
>  
> -- 
> 2.24.0.rc1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list