From 2c63e0f92e2fe3400ebfec7952f9dcbff6a583a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 1 Oct 2021 16:01:03 +0300 Subject: drm/i915: Hoover the level>=n_entries WARN into intel_ddi_level() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All callers of intel_ddi_level() duplicate the check+WARN to make sure the returned level is actually present in the appropriate buf_trans table. Let's push that stuff into intel_ddi_level() so the callers don't have to worry about it. Reviewed-by: Imre Deak Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211001130107.1746-7-ville.syrjala@linux.intel.com --- drivers/gpu/drm/i915/display/intel_snps_phy.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/gpu/drm/i915/display/intel_snps_phy.c') diff --git a/drivers/gpu/drm/i915/display/intel_snps_phy.c b/drivers/gpu/drm/i915/display/intel_snps_phy.c index f59cc320ce9c..7a9771dbb63f 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_phy.c +++ b/drivers/gpu/drm/i915/display/intel_snps_phy.c @@ -64,8 +64,6 @@ void intel_snps_phy_set_signal_levels(struct intel_encoder *encoder, trans = encoder->get_buf_trans(encoder, crtc_state, &n_entries); if (drm_WARN_ON_ONCE(&dev_priv->drm, !trans)) return; - if (drm_WARN_ON_ONCE(&dev_priv->drm, level < 0 || level >= n_entries)) - level = n_entries - 1; for (ln = 0; ln < 4; ln++) { u32 val = 0; -- cgit v1.2.3