]> www.infradead.org Git - users/hch/misc.git/commitdiff
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 28394de028855ee3f1e430f5da56871750460edf..640087e862f8480bbf6184b663bc522d6b7b39c3 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 3861bc6c96219cac68d6401201fd105c60165f55..dfd01440737df7e3d286b20b7fe0bd29cca84c9a 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 cd3fbc0591d82770a4eba47baa3b6210d07ea59b..c60b8fe90819d9fd8813c607ac70d18704691194 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 7ed0242a4b3311e470b7e75b51b6cddb619c2514..55d2464365d04f2cf0683d3895e2da5293f0bde4 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));