Commit 6b9e441d authored by Paulo Zanoni's avatar Paulo Zanoni

drm/i915: remove potentially confusing IS_G4X checks

The IS_G4X macro is defined as IS_G45 || IS_GM45. We have two points
in our code where we have an if statement checking for GM45 followed
by an else if statement checking for IS_G4X. This can be confusing
since the IS_G4X check won't be catching the previously-checked GM45.
Someone quickly trying to check which functions run on each platform
may end up getting confused while reading the code.

Fix the potential confusion by limiting the else if statements to only
check for the platform that was not already checked earlier in the if
ladder.
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1487620842-22893-3-git-send-email-paulo.r.zanoni@intel.com
parent 64486ae7
...@@ -223,7 +223,7 @@ static unsigned int intel_hpll_vco(struct drm_i915_private *dev_priv) ...@@ -223,7 +223,7 @@ static unsigned int intel_hpll_vco(struct drm_i915_private *dev_priv)
/* FIXME other chipsets? */ /* FIXME other chipsets? */
if (IS_GM45(dev_priv)) if (IS_GM45(dev_priv))
vco_table = ctg_vco; vco_table = ctg_vco;
else if (IS_G4X(dev_priv)) else if (IS_G45(dev_priv))
vco_table = elk_vco; vco_table = elk_vco;
else if (IS_I965GM(dev_priv)) else if (IS_I965GM(dev_priv))
vco_table = cl_vco; vco_table = cl_vco;
...@@ -1859,7 +1859,7 @@ void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv) ...@@ -1859,7 +1859,7 @@ void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv)
dev_priv->display.get_cdclk = fixed_450mhz_get_cdclk; dev_priv->display.get_cdclk = fixed_450mhz_get_cdclk;
else if (IS_GM45(dev_priv)) else if (IS_GM45(dev_priv))
dev_priv->display.get_cdclk = gm45_get_cdclk; dev_priv->display.get_cdclk = gm45_get_cdclk;
else if (IS_G4X(dev_priv)) else if (IS_G45(dev_priv))
dev_priv->display.get_cdclk = g33_get_cdclk; dev_priv->display.get_cdclk = g33_get_cdclk;
else if (IS_I965GM(dev_priv)) else if (IS_I965GM(dev_priv))
dev_priv->display.get_cdclk = i965gm_get_cdclk; dev_priv->display.get_cdclk = i965gm_get_cdclk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment