drm/i915: s/int i/enum hpd_pin pin/
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 5 Jul 2018 16:43:54 +0000 (19:43 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 13 Jul 2018 15:22:22 +0000 (18:22 +0300)
Use the enum hpd_pin type when talking about HPD pins, and rename the
variable from a very nondescript 'i' to 'pin', a name we already
use in other parts of the code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-6-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_hotplug.c

index 495b9d27990e731578e77e3790768a93e4896d52..bd9c77c804ab7828bea0102524d5fe6f2c73c88d 100644 (file)
@@ -1712,20 +1712,20 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv,
                               bool long_pulse_detect(enum port port, u32 val))
 {
        enum port port;
-       int i;
+       enum hpd_pin pin;
 
-       for_each_hpd_pin(i) {
-               if ((hpd[i] & hotplug_trigger) == 0)
+       for_each_hpd_pin(pin) {
+               if ((hpd[pin] & hotplug_trigger) == 0)
                        continue;
 
-               *pin_mask |= BIT(i);
+               *pin_mask |= BIT(pin);
 
-               port = intel_hpd_pin_to_port(dev_priv, i);
+               port = intel_hpd_pin_to_port(dev_priv, pin);
                if (port == PORT_NONE)
                        continue;
 
                if (long_pulse_detect(port, dig_hotplug_reg))
-                       *long_mask |= BIT(i);
+                       *long_mask |= BIT(pin);
        }
 
        DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x\n",
index f862441158e1b39a18feef943a3ddf17cab3acca..d9d61d11dd2bf3011114d6f0139a4de0ddfd925a 100644 (file)
@@ -241,25 +241,25 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
                container_of(work, typeof(*dev_priv),
                             hotplug.reenable_work.work);
        struct drm_device *dev = &dev_priv->drm;
-       int i;
+       enum hpd_pin pin;
 
        intel_runtime_pm_get(dev_priv);
 
        spin_lock_irq(&dev_priv->irq_lock);
-       for_each_hpd_pin(i) {
+       for_each_hpd_pin(pin) {
                struct drm_connector *connector;
                struct drm_connector_list_iter conn_iter;
 
-               if (dev_priv->hotplug.stats[i].state != HPD_DISABLED)
+               if (dev_priv->hotplug.stats[pin].state != HPD_DISABLED)
                        continue;
 
-               dev_priv->hotplug.stats[i].state = HPD_ENABLED;
+               dev_priv->hotplug.stats[pin].state = HPD_ENABLED;
 
                drm_connector_list_iter_begin(dev, &conn_iter);
                drm_for_each_connector_iter(connector, &conn_iter) {
                        struct intel_connector *intel_connector = to_intel_connector(connector);
 
-                       if (intel_connector->encoder->hpd_pin == i) {
+                       if (intel_connector->encoder->hpd_pin == pin) {
                                if (connector->polled != intel_connector->polled)
                                        DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
                                                         connector->name);
@@ -432,14 +432,14 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
 
        spin_lock(&dev_priv->irq_lock);
        for_each_intel_encoder(&dev_priv->drm, encoder) {
-               enum hpd_pin i = encoder->hpd_pin;
+               enum hpd_pin pin = encoder->hpd_pin;
                bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder);
 
-               if (!(BIT(i) & pin_mask))
+               if (!(BIT(pin) & pin_mask))
                        continue;
 
                if (has_hpd_pulse) {
-                       bool long_hpd = long_mask & BIT(i);
+                       bool long_hpd = long_mask & BIT(pin);
                        enum port port = encoder->port;
 
                        DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port),
@@ -458,7 +458,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
                        }
                }
 
-               if (dev_priv->hotplug.stats[i].state == HPD_DISABLED) {
+               if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) {
                        /*
                         * On GMCH platforms the interrupt mask bits only
                         * prevent irq generation, not the setting of the
@@ -466,20 +466,20 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
                         * interrupts on saner platforms.
                         */
                        WARN_ONCE(!HAS_GMCH_DISPLAY(dev_priv),
-                                 "Received HPD interrupt on pin %d although disabled\n", i);
+                                 "Received HPD interrupt on pin %d although disabled\n", pin);
                        continue;
                }
 
-               if (dev_priv->hotplug.stats[i].state != HPD_ENABLED)
+               if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED)
                        continue;
 
                if (!has_hpd_pulse) {
-                       dev_priv->hotplug.event_bits |= BIT(i);
+                       dev_priv->hotplug.event_bits |= BIT(pin);
                        queue_hp = true;
                }
 
-               if (intel_hpd_irq_storm_detect(dev_priv, i)) {
-                       dev_priv->hotplug.event_bits &= ~BIT(i);
+               if (intel_hpd_irq_storm_detect(dev_priv, pin)) {
+                       dev_priv->hotplug.event_bits &= ~BIT(pin);
                        storm_detected = true;
                }
        }