drm/amd/display: Use boolean context for pointer null checks
authorQianfeng Rong <rongqianfeng@vivo.com>
Tue, 12 Aug 2025 08:31:49 +0000 (16:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Aug 2025 17:03:57 +0000 (13:03 -0400)
Replace "out == 0" with "!out" for pointer comparison to improve code
readability and conform to coding style.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_factory.c
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c

index 28394de..640087e 100644 (file)
@@ -10,7 +10,7 @@ bool dml2_core_create(enum dml2_project_id project_id, struct dml2_core_instance
 {
        bool result = false;
 
-       if (out == 0)
+       if (!out)
                return false;
 
        memset(out, 0, sizeof(struct dml2_core_instance));
index 3861bc6..dfd0144 100644 (file)
@@ -20,7 +20,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance
 {
        bool result = false;
 
-       if (out == 0)
+       if (!out)
                return false;
 
        memset(out, 0, sizeof(struct dml2_dpmm_instance));
index cd3fbc0..c60b8fe 100644 (file)
@@ -15,7 +15,7 @@ bool dml2_mcg_create(enum dml2_project_id project_id, struct dml2_mcg_instance *
 {
        bool result = false;
 
-       if (out == 0)
+       if (!out)
                return false;
 
        memset(out, 0, sizeof(struct dml2_mcg_instance));
index 7ed0242..55d2464 100644 (file)
@@ -26,7 +26,7 @@ bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance *
 {
        bool result = false;
 
-       if (out == 0)
+       if (!out)
                return false;
 
        memset(out, 0, sizeof(struct dml2_pmo_instance));