2022-03-22 11:07:55

by baihaowen

[permalink] [raw]
Subject: [PATCH] drm/amd/display: use NULL instead of using plain integer as pointer

This fixes the following sparse warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dsc/rc_calc_fpu.c:71:40: warning: Using
plain integer as NULL pointer

Signed-off-by: Haowen Bai <[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 ec636d0..ef75eb7 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
@@ -68,7 +68,7 @@ static void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc,
int sel = table_hash(mode, bpc, max_min);
int table_size = 0;
int index;
- const struct qp_entry *table = 0L;
+ const struct qp_entry *table = NULL;

// alias enum
enum { min = DAL_MM_MIN, max = DAL_MM_MAX };
--
2.7.4


2022-03-24 20:15:30

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] drm/amd/display: use NULL instead of using plain integer as pointer

Thanks for the patches. I've already applied fixes from others for
these issues.

Alex

On Tue, Mar 22, 2022 at 9:05 AM Haowen Bai <[email protected]> wrote:
>
> This fixes the following sparse warnings:
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dsc/rc_calc_fpu.c:71:40: warning: Using
> plain integer as NULL pointer
>
> Signed-off-by: Haowen Bai <[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 ec636d0..ef75eb7 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
> @@ -68,7 +68,7 @@ static void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc,
> int sel = table_hash(mode, bpc, max_min);
> int table_size = 0;
> int index;
> - const struct qp_entry *table = 0L;
> + const struct qp_entry *table = NULL;
>
> // alias enum
> enum { min = DAL_MM_MIN, max = DAL_MM_MAX };
> --
> 2.7.4
>