From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: remove potentially confusing IS_G4X checks
Date: Tue, 21 Feb 2017 13:45:37 +0200 [thread overview]
Message-ID: <20170221114537.GD31595@intel.com> (raw)
In-Reply-To: <1487620842-22893-3-git-send-email-paulo.r.zanoni@intel.com>
On Mon, Feb 20, 2017 at 05:00:41PM -0300, Paulo Zanoni wrote:
> 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: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_cdclk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
> index dd6fe25..942adf0 100644
> --- a/drivers/gpu/drm/i915/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/intel_cdclk.c
> @@ -223,7 +223,7 @@ static unsigned int intel_hpll_vco(struct drm_i915_private *dev_priv)
> /* FIXME other chipsets? */
> if (IS_GM45(dev_priv))
> vco_table = ctg_vco;
> - else if (IS_G4X(dev_priv))
> + else if (IS_G45(dev_priv))
> vco_table = elk_vco;
> else if (IS_I965GM(dev_priv))
> vco_table = cl_vco;
> @@ -1778,7 +1778,7 @@ void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv)
> dev_priv->display.get_cdclk = fixed_450mhz_get_cdclk;
> else if (IS_GM45(dev_priv))
> 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;
> else if (IS_I965GM(dev_priv))
> dev_priv->display.get_cdclk = i965gm_get_cdclk;
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-21 11:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 20:00 [PATCH 0/3] Small clocking code refactor, v2 Paulo Zanoni
2017-02-20 20:00 ` [PATCH 1/3] drm/i915: unify the x_modeset_calc_cdclk() functions Paulo Zanoni
2017-03-02 20:28 ` Ville Syrjälä
2017-03-03 12:13 ` Ander Conselvan De Oliveira
2017-02-20 20:00 ` [PATCH 2/3] drm/i915: remove potentially confusing IS_G4X checks Paulo Zanoni
2017-02-21 11:45 ` Ville Syrjälä [this message]
2017-02-20 20:00 ` [PATCH 3/3] drm/i915: reorganize the get_cdclk assignment Paulo Zanoni
2017-02-21 11:51 ` Ville Syrjälä
2017-02-21 19:45 ` Paulo Zanoni
2017-02-21 12:26 ` Ander Conselvan De Oliveira
2017-02-21 19:56 ` Paulo Zanoni
2017-02-20 20:52 ` ✓ Fi.CI.BAT: success for Small clocking code refactor, v2 Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170221114537.GD31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).