Skip to content

Commit 34957e8

Browse files
committed
drm/i915/bios: reduce indent in parse_general_features
Slightly cleaner with early exit. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1450271061-32646-4-git-send-email-jani.nikula@intel.com
1 parent 98f3a1d commit 34957e8

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

drivers/gpu/drm/i915/intel_bios.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -353,25 +353,26 @@ parse_general_features(struct drm_i915_private *dev_priv,
353353
const struct bdb_general_features *general;
354354

355355
general = find_section(bdb, BDB_GENERAL_FEATURES);
356-
if (general) {
357-
dev_priv->vbt.int_tv_support = general->int_tv_support;
358-
/* int_crt_support can't be trusted on earlier platforms */
359-
if (bdb->version >= 155 &&
360-
(HAS_DDI(dev_priv) || IS_VALLEYVIEW(dev_priv)))
361-
dev_priv->vbt.int_crt_support = general->int_crt_support;
362-
dev_priv->vbt.lvds_use_ssc = general->enable_ssc;
363-
dev_priv->vbt.lvds_ssc_freq =
364-
intel_bios_ssc_frequency(dev_priv, general->ssc_freq);
365-
dev_priv->vbt.display_clock_mode = general->display_clock_mode;
366-
dev_priv->vbt.fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
367-
DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
368-
dev_priv->vbt.int_tv_support,
369-
dev_priv->vbt.int_crt_support,
370-
dev_priv->vbt.lvds_use_ssc,
371-
dev_priv->vbt.lvds_ssc_freq,
372-
dev_priv->vbt.display_clock_mode,
373-
dev_priv->vbt.fdi_rx_polarity_inverted);
374-
}
356+
if (!general)
357+
return;
358+
359+
dev_priv->vbt.int_tv_support = general->int_tv_support;
360+
/* int_crt_support can't be trusted on earlier platforms */
361+
if (bdb->version >= 155 &&
362+
(HAS_DDI(dev_priv) || IS_VALLEYVIEW(dev_priv)))
363+
dev_priv->vbt.int_crt_support = general->int_crt_support;
364+
dev_priv->vbt.lvds_use_ssc = general->enable_ssc;
365+
dev_priv->vbt.lvds_ssc_freq =
366+
intel_bios_ssc_frequency(dev_priv, general->ssc_freq);
367+
dev_priv->vbt.display_clock_mode = general->display_clock_mode;
368+
dev_priv->vbt.fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
369+
DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
370+
dev_priv->vbt.int_tv_support,
371+
dev_priv->vbt.int_crt_support,
372+
dev_priv->vbt.lvds_use_ssc,
373+
dev_priv->vbt.lvds_ssc_freq,
374+
dev_priv->vbt.display_clock_mode,
375+
dev_priv->vbt.fdi_rx_polarity_inverted);
375376
}
376377

377378
static void

0 commit comments

Comments
 (0)