]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix warning comparing pointer to 0
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Mon, 1 Jul 2024 07:04:52 +0000 (15:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Jul 2024 22:04:45 +0000 (18:04 -0400)
Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c:24:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c

index 657ec2e1b119f55b54f12c2b16b1f198c93813f8..2c983daf2dadf3b9445b1379a0926fa2ee88fb30 100644 (file)
@@ -21,7 +21,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));