Skip to content

Commit

Permalink
drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other 'reg'
Browse files Browse the repository at this point in the history
On VLV/CHV the rc6 residency calculations read a second register to
determine the actual units used for the residency value. The variable
name 'reg' where that register value is stored shadows the function
argument 'reg'. That can easily leave the reader utterly confused, so
rename the internal variable to 'clk_reg'.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Deepak S<deepak.s@intel.com>
[danvet: Spellfix in commit message.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ville Syrjälä authored and Daniel Vetter committed Jan 27, 2015
1 parent b5c46aa commit f78ae63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)

/* On VLV and CHV, residency time is in CZ units rather than 1.28us */
if (IS_VALLEYVIEW(dev)) {
u32 reg, czcount_30ns;
u32 clk_reg, czcount_30ns;

if (IS_CHERRYVIEW(dev))
reg = CHV_CLK_CTL1;
clk_reg = CHV_CLK_CTL1;
else
reg = VLV_CLK_CTL2;
clk_reg = VLV_CLK_CTL2;

czcount_30ns = I915_READ(reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;
czcount_30ns = I915_READ(clk_reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;

if (!czcount_30ns) {
WARN(!czcount_30ns, "bogus CZ count value");
Expand Down

0 comments on commit f78ae63

Please sign in to comment.