drm/radeon|amdgpu: Remove redundant num_connectors check
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 13 Dec 2016 23:08:04 +0000 (00:08 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 18 Dec 2016 13:18:12 +0000 (14:18 +0100)
The list walk will shortcircuit anyway.

Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161213230814.19598-4-daniel.vetter@ffwll.ch
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
drivers/gpu/drm/radeon/radeon_irq_kms.c

index fb902932f571f40d6710f3becf29fa9a2eeea022..e63ece049b05da62f2233c9630f5559d3c8caeb5 100644 (file)
@@ -61,10 +61,8 @@ static void amdgpu_hotplug_work_func(struct work_struct *work)
        struct drm_connector *connector;
 
        mutex_lock(&mode_config->mutex);
-       if (mode_config->num_connector) {
-               list_for_each_entry(connector, &mode_config->connector_list, head)
-                       amdgpu_connector_hotplug(connector);
-       }
+       list_for_each_entry(connector, &mode_config->connector_list, head)
+               amdgpu_connector_hotplug(connector);
        mutex_unlock(&mode_config->mutex);
        /* Just fire off a uevent and let userspace tell us what to do */
        drm_helper_hpd_irq_event(dev);
index c084cadcbf2156f8f51b05d21b5ae79407bc6853..1b7528df7f7f8ddedce860f028c339b2cf2e09a7 100644 (file)
@@ -85,10 +85,8 @@ static void radeon_hotplug_work_func(struct work_struct *work)
                return;
 
        mutex_lock(&mode_config->mutex);
-       if (mode_config->num_connector) {
-               list_for_each_entry(connector, &mode_config->connector_list, head)
-                       radeon_connector_hotplug(connector);
-       }
+       list_for_each_entry(connector, &mode_config->connector_list, head)
+               radeon_connector_hotplug(connector);
        mutex_unlock(&mode_config->mutex);
        /* Just fire off a uevent and let userspace tell us what to do */
        drm_helper_hpd_irq_event(dev);
@@ -103,10 +101,8 @@ static void radeon_dp_work_func(struct work_struct *work)
        struct drm_connector *connector;
 
        /* this should take a mutex */
-       if (mode_config->num_connector) {
-               list_for_each_entry(connector, &mode_config->connector_list, head)
-                       radeon_connector_hotplug(connector);
-       }
+       list_for_each_entry(connector, &mode_config->connector_list, head)
+               radeon_connector_hotplug(connector);
 }
 /**
  * radeon_driver_irq_preinstall_kms - drm irq preinstall callback