[Intel-gfx] [PATCH v2 12/13] drm/i915/dp: localize link rate index variable more

Manasi Navare manasi.d.navare at intel.com
Tue Feb 7 20:17:35 UTC 2017


This has been tested to correctly execute the compliance request.

Reviewed-by: Manasi Navare <manasi.d.navare at intel.com>

Manasi

On Fri, Feb 03, 2017 at 04:19:35PM +0200, Jani Nikula wrote:
> Localize link_rate_index to the if block, and rename to just index to
> reduce indent.
> 
> Cc: Manasi Navare <manasi.d.navare at intel.com>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 58ec70f316c5..90ae95f2ecb2 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1640,7 +1640,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
>  	/* Conveniently, the link BW constants become indices with a shift...*/
>  	int min_clock = 0;
>  	int max_clock;
> -	int link_rate_index;
>  	int bpp, mode_rate;
>  	int link_avail, link_clock;
>  	int common_len;
> @@ -1684,11 +1683,13 @@ intel_dp_compute_config(struct intel_encoder *encoder,
>  
>  	/* Use values requested by Compliance Test Request */
>  	if (intel_dp->compliance.test_type == DP_TEST_LINK_TRAINING) {
> -		link_rate_index = intel_dp_rate_index(intel_dp->common_rates,
> -						      intel_dp->num_common_rates,
> -						      intel_dp->compliance.test_link_rate);
> -		if (link_rate_index >= 0)
> -			min_clock = max_clock = link_rate_index;
> +		int index;
> +
> +		index = intel_dp_rate_index(intel_dp->common_rates,
> +					    intel_dp->num_common_rates,
> +					    intel_dp->compliance.test_link_rate);
> +		if (index >= 0)
> +			min_clock = max_clock = index;
>  		min_lane_count = max_lane_count = intel_dp->compliance.test_lane_count;
>  	}
>  	DRM_DEBUG_KMS("DP link computation with max lane count %i "
> -- 
> 2.1.4
> 


More information about the Intel-gfx mailing list