From: Magali Lemes <magalilemes00@gmail.com>
To: harry.wentland@amd.com, sunpeng.li@amd.com,
Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie,
daniel@ffwll.ch
Cc: siqueirajordao@riseup.net, mwen@igalia.com, maira.canal@usp.br,
isabbasso@riseup.net, Magali Lemes <magalilemes00@gmail.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] drm/amd/display: Use NULL instead of 0
Date: Thu, 24 Feb 2022 16:15:50 -0300 [thread overview]
Message-ID: <20220224191551.69103-4-magalilemes00@gmail.com> (raw)
In-Reply-To: <20220224191551.69103-1-magalilemes00@gmail.com>
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
Signed-off-by: Magali Lemes <magalilemes00@gmail.com>
---
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 | 4 +---
3 files changed, 4 insertions(+), 6 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 4367a6e0c224..cc8e60ec35c6 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 ace04e2ed34e..8378b80e8517 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 ee55cda854bf..8104c0c67f78 100644
--- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
@@ -858,11 +858,9 @@ static struct clock_source *find_matching_pll(
return pool->clock_sources[DCE112_CLK_SRC_PLL4];
case TRANSMITTER_UNIPHY_F:
return pool->clock_sources[DCE112_CLK_SRC_PLL5];
- default:
- return NULL;
}
- return 0;
+ return NULL;
}
static enum dc_status build_mapped_resource(
--
2.25.1
next prev parent reply other threads:[~2022-02-24 19:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 19:15 [PATCH 0/4] Address a few compilation warnings Magali Lemes
2022-02-24 19:15 ` [PATCH 1/4] drm/amd/display: Adjust functions documentation Magali Lemes
2022-02-24 19:15 ` [PATCH 2/4] drm/amd/display: Add conditional around function Magali Lemes
2022-02-24 19:15 ` Magali Lemes [this message]
2022-02-24 19:15 ` [PATCH 4/4] drm/amd/display: Turn functions into static Magali Lemes
2022-02-24 19:43 ` [PATCH 0/4] Address a few compilation warnings Harry Wentland
2022-02-24 20:23 ` Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224191551.69103-4-magalilemes00@gmail.com \
--to=magalilemes00@gmail.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=isabbasso@riseup.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maira.canal@usp.br \
--cc=mwen@igalia.com \
--cc=siqueirajordao@riseup.net \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®