]> git.hungrycats.org Git - linux/commitdiff
drm/amd/display: Simplify boolean checks
authorAlex Hung <alex.hung@amd.com>
Mon, 15 Jun 2026 21:42:59 +0000 (15:42 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 15:31:33 +0000 (11:31 -0400)
[WHAT]
Use direct boolean in connector and IRQ code paths. This removes
redundant comparisons around MST state, IRQ validation, handler
removal, and DMUB notification offload without changing behavior.

Assisted-by: Copilot:GPT-5
Reviewed-by: Chen-Yu Chen <chen-yu.chen@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c

index 959c843fb77cf1d7057840c6e59084250b7e2363..d4720c5576cef1ea8495775f2632a7e9c3b0a5d1 100644 (file)
@@ -466,7 +466,7 @@ void amdgpu_dm_update_connector_after_detect(
        struct drm_device *dev = connector->dev;
 
        /* MST handled by drm_mst framework */
-       if (aconnector->mst_mgr.mst_state == true)
+       if (aconnector->mst_mgr.mst_state)
                return;
 
        sink = aconnector->dc_link->local_sink;
index 57dd176e4cc13b8cdc1d2a4c5fd8b4298ea59076..ffaf2b7bc35d74eae3239b3c5c99453d386131d9 100644 (file)
@@ -188,7 +188,7 @@ static struct list_head *remove_irq_handler(struct amdgpu_device *adev,
 
        DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
 
-       if (handler_removed == false) {
+       if (!handler_removed) {
                /* Not necessarily an error - caller may not
                 * know the context.
                 */
@@ -326,7 +326,7 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,
        unsigned long irq_table_flags;
        enum dc_irq_source irq_source;
 
-       if (false == validate_irq_registration_params(int_params, ih))
+       if (!validate_irq_registration_params(int_params, ih))
                return DAL_INVALID_IRQ_HANDLER_IDX;
 
        handler_data = kzalloc_obj(*handler_data);
@@ -392,7 +392,7 @@ void amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev,
        struct dc_interrupt_params int_params;
        int i;
 
-       if (false == validate_irq_unregistration_params(irq_source, ih))
+       if (!validate_irq_unregistration_params(irq_source, ih))
                return;
 
        memset(&int_params, 0, sizeof(int_params));
@@ -2188,7 +2188,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
                                        dmub_notification_type_str(notify.type));
                                continue;
                        }
-                       if (dm->dmub_thread_offload[notify.type] == true) {
+                       if (dm->dmub_thread_offload[notify.type]) {
                                dmub_hpd_wrk = kzalloc_obj(*dmub_hpd_wrk,
                                                           GFP_ATOMIC);
                                if (!dmub_hpd_wrk) {