Skip to content

Commit e6790f7

Browse files
zhengbin13robclark
authored andcommitted
drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder.c
Fixes coccicheck warning: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:464:56-57: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:15-16: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:32-33: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:49-50: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1968:17-18: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1981:17-18: WARNING comparing pointer to 0 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:2012:51-52: WARNING comparing pointer to 0 Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zheng Bin <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent a41aa44 commit e6790f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ void dpu_encoder_helper_split_config(
459459
struct msm_display_info *disp_info;
460460

461461
if (!phys_enc->hw_mdptop || !phys_enc->parent) {
462-
DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != 0);
462+
DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != NULL);
463463
return;
464464
}
465465

@@ -567,7 +567,7 @@ static int dpu_encoder_virt_atomic_check(
567567

568568
if (!drm_enc || !crtc_state || !conn_state) {
569569
DPU_ERROR("invalid arg(s), drm_enc %d, crtc/conn state %d/%d\n",
570-
drm_enc != 0, crtc_state != 0, conn_state != 0);
570+
drm_enc != NULL, crtc_state != NULL, conn_state != NULL);
571571
return -EINVAL;
572572
}
573573

@@ -1947,7 +1947,7 @@ static int dpu_encoder_virt_add_phys_encs(
19471947
if (IS_ERR_OR_NULL(enc)) {
19481948
DPU_ERROR_ENC(dpu_enc, "failed to init vid enc: %ld\n",
19491949
PTR_ERR(enc));
1950-
return enc == 0 ? -EINVAL : PTR_ERR(enc);
1950+
return enc == NULL ? -EINVAL : PTR_ERR(enc);
19511951
}
19521952

19531953
dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
@@ -1960,7 +1960,7 @@ static int dpu_encoder_virt_add_phys_encs(
19601960
if (IS_ERR_OR_NULL(enc)) {
19611961
DPU_ERROR_ENC(dpu_enc, "failed to init cmd enc: %ld\n",
19621962
PTR_ERR(enc));
1963-
return enc == 0 ? -EINVAL : PTR_ERR(enc);
1963+
return enc == NULL ? -EINVAL : PTR_ERR(enc);
19641964
}
19651965

19661966
dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
@@ -1991,7 +1991,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
19911991
struct dpu_enc_phys_init_params phys_params;
19921992

19931993
if (!dpu_enc) {
1994-
DPU_ERROR("invalid arg(s), enc %d\n", dpu_enc != 0);
1994+
DPU_ERROR("invalid arg(s), enc %d\n", dpu_enc != NULL);
19951995
return -EINVAL;
19961996
}
19971997

0 commit comments

Comments
 (0)