drm/i915: simplify conditions for skipping the 2nd hpd loop iterations
authorJani Nikula <jani.nikula@intel.com>
Thu, 28 May 2015 12:43:49 +0000 (15:43 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 29 May 2015 08:15:29 +0000 (10:15 +0200)
Multiple positive and negative checks for hpd[i] & hotplug_trigger gets
hard to read. Simplify. This should make follow-up patches merging the
two loops easier. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c

index ad8897828b0cf552a47588a4ad22910430cb3a56..536e97381cefeee896e869e84f3e45a2eb9693eb 100644 (file)
@@ -1478,8 +1478,10 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
        }
 
        for_each_hpd_pin(i) {
-               if (hpd[i] & hotplug_trigger &&
-                   dev_priv->hotplug.stats[i].state == HPD_DISABLED) {
+               if (!(hpd[i] & hotplug_trigger))
+                       continue;
+
+               if (dev_priv->hotplug.stats[i].state == HPD_DISABLED) {
                        /*
                         * On GMCH platforms the interrupt mask bits only
                         * prevent irq generation, not the setting of the
@@ -1493,8 +1495,7 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
                        continue;
                }
 
-               if (!(hpd[i] & hotplug_trigger) ||
-                   dev_priv->hotplug.stats[i].state != HPD_ENABLED)
+               if (dev_priv->hotplug.stats[i].state != HPD_ENABLED)
                        continue;
 
                if (!(dig_port_mask & hpd[i])) {