From: Ville Syrjälä Date: Thu, 28 Jul 2016 14:50:45 +0000 (+0300) Subject: drm/i915: Remove useless rate_to_index() usage X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1354f734c5f3e9f08f97d22aff97612ee7ec9d3e;p=linux-beck.git drm/i915: Remove useless rate_to_index() usage No need to iterate the rates array in intel_dp_max_link_rate(). We know the max rate will be the last entry, and we already know the size. Cc: Ander Conselvan de Oliveira Cc: Jim Bride Cc: Manasi D Navare Cc: Durgadoss R Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/1469717448-4297-10-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index a0c99c06210e..65943ae3df56 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1447,7 +1447,7 @@ intel_dp_max_link_rate(struct intel_dp *intel_dp) if (WARN_ON(len <= 0)) return 162000; - return rates[rate_to_index(0, rates) - 1]; + return rates[len - 1]; } int intel_dp_rate_select(struct intel_dp *intel_dp, int rate)