2021-11-24 10:20:50

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] drm/amd/display: Fix warning comparing pointer to 0

Fix the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c:96:14-15: WARNING
comparing pointer to 0.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
index 122ba29..ec636d0 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
@@ -93,7 +93,7 @@ static void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc,
TABLE_CASE(420, 12, min);
}

- if (table == 0)
+ if (!table)
return;

index = (bpp - table[0].bpp) * 2;
--
1.8.3.1



2021-11-24 19:40:44

by Rodrigo Siqueira Jordao

[permalink] [raw]
Subject: Re: [PATCH] drm/amd/display: Fix warning comparing pointer to 0



On 2021-11-24 5:20 a.m., Jiapeng Chong wrote:
> Fix the following coccicheck warning:
>
> ./drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c:96:14-15: WARNING
> comparing pointer to 0.
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
> index 122ba29..ec636d0 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c
> @@ -93,7 +93,7 @@ static void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc,
> TABLE_CASE(420, 12, min);
> }
>
> - if (table == 0)
> + if (!table)
> return;
>
> index = (bpp - table[0].bpp) * 2;
>

Reviewed-by: Rodrigo Siqueira <[email protected]>

Applied to amd-staging-drm-next

Thanks