drm/i915: Stop using a 'reg' variable
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 1 Nov 2023 11:42:09 +0000 (13:42 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 6 Nov 2023 07:53:43 +0000 (09:53 +0200)
'reg' is a very non-descriptive name. Just get rid of the silly
local variable and spell out the full register name always.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231101114212.9345-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index 121ebba..9e9c032 100644 (file)
@@ -398,7 +398,6 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder;
        enum pipe pipe = crtc->pipe;
-       i915_reg_t reg;
        u32 val;
 
        drm_dbg_kms(&dev_priv->drm, "enabling pipe %c\n", pipe_name(pipe));
@@ -431,16 +430,16 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
                intel_de_rmw(dev_priv, PIPE_ARB_CTL(pipe),
                             0, PIPE_ARB_USE_PROG_SLOTS);
 
-       reg = TRANSCONF(cpu_transcoder);
-       val = intel_de_read(dev_priv, reg);
+       val = intel_de_read(dev_priv, TRANSCONF(cpu_transcoder));
        if (val & TRANSCONF_ENABLE) {
                /* we keep both pipes enabled on 830 */
                drm_WARN_ON(&dev_priv->drm, !IS_I830(dev_priv));
                return;
        }
 
-       intel_de_write(dev_priv, reg, val | TRANSCONF_ENABLE);
-       intel_de_posting_read(dev_priv, reg);
+       intel_de_write(dev_priv, TRANSCONF(cpu_transcoder),
+                      val | TRANSCONF_ENABLE);
+       intel_de_posting_read(dev_priv, TRANSCONF(cpu_transcoder));
 
        /*
         * Until the pipe starts PIPEDSL reads will return a stale value,
@@ -459,7 +458,6 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder;
        enum pipe pipe = crtc->pipe;
-       i915_reg_t reg;
        u32 val;
 
        drm_dbg_kms(&dev_priv->drm, "disabling pipe %c\n", pipe_name(pipe));
@@ -470,8 +468,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
         */
        assert_planes_disabled(crtc);
 
-       reg = TRANSCONF(cpu_transcoder);
-       val = intel_de_read(dev_priv, reg);
+       val = intel_de_read(dev_priv, TRANSCONF(cpu_transcoder));
        if ((val & TRANSCONF_ENABLE) == 0)
                return;
 
@@ -486,7 +483,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
        if (!IS_I830(dev_priv))
                val &= ~TRANSCONF_ENABLE;
 
-       intel_de_write(dev_priv, reg, val);
+       intel_de_write(dev_priv, TRANSCONF(cpu_transcoder), val);
 
        if (DISPLAY_VER(dev_priv) >= 12)
                intel_de_rmw(dev_priv, hsw_chicken_trans_reg(dev_priv, cpu_transcoder),