From b83e1ba9395dd39f6336358dd0cbc8ca6ced21e7 Mon Sep 17 00:00:00 2001 From: Magali Lemes Date: Thu, 24 Feb 2022 16:15:50 -0300 Subject: [PATCH] drm/amd/display: Use NULL instead of 0 Silence the following sparse warnings: ../drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:865:16: sparse: warning: Using plain integer as NULL pointer ../drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:1588:84: sparse: warning: Using plain integer as NULL pointer ../drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2725:84: sparse: warning: Using plain integer as NULL pointer ../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1919:16: sparse: warning: Using plain integer as NULL pointer v2: drop removal of default case to avoid adding warnings (Alex) Reviewed-by: Harry Wentland Signed-off-by: Magali Lemes Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 4367a6e0c224f..cc8e60ec35c64 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -1924,7 +1924,7 @@ static struct audio *find_first_free_audio( return pool->audios[i]; } } - return 0; + return NULL; } /* diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index ace04e2ed34ea..8378b80e85177 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -1585,7 +1585,7 @@ static enum dc_status apply_single_controller_ctx_to_hw( hws->funcs.enable_stream_timing(pipe_ctx, context, dc); } - pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0; + pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != NULL; pipe_ctx->stream->link->psr_settings.psr_feature_enabled = false; @@ -2722,7 +2722,7 @@ static void dce110_program_front_end_for_pipe( pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust); - pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0; + pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != NULL; program_scaler(dc, pipe_ctx); diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c index ee55cda854bf4..560da6cbcaa3d 100644 --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c @@ -862,7 +862,7 @@ static struct clock_source *find_matching_pll( return NULL; } - return 0; + return NULL; } static enum dc_status build_mapped_resource( -- 2.30.2