* [PATCH] drm/msm/dpu: don't access mode pointer before it is set
@ 2022-05-02 8:24 Dmitry Baryshkov
2022-05-02 16:19 ` Abhinav Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2022-05-02 8:24 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Abhinav Kumar
Cc: kernel test robot, David Airlie, linux-arm-msm, dri-devel,
Bjorn Andersson, Stephen Boyd, freedreno
Move the initializer for the mode variable to the declaration point to
remove unitialized variable access from the DEBUG_DPU macro. This fixes
the following warning:
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:250:37: note: initialize the variable 'mode' to silence this warning
Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
index f4a79715a02e..4829d1ce0cf8 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
@@ -247,7 +247,7 @@ static int dpu_encoder_phys_wb_atomic_check(
struct drm_connector_state *conn_state)
{
struct drm_framebuffer *fb;
- const struct drm_display_mode *mode;
+ const struct drm_display_mode *mode = &crtc_state->mode;
DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
@@ -256,7 +256,6 @@ static int dpu_encoder_phys_wb_atomic_check(
return 0;
fb = conn_state->writeback_job->fb;
- mode = &crtc_state->mode;
if (!conn_state || !conn_state->connector) {
DPU_ERROR("invalid connector state\n");
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/msm/dpu: don't access mode pointer before it is set
2022-05-02 8:24 [PATCH] drm/msm/dpu: don't access mode pointer before it is set Dmitry Baryshkov
@ 2022-05-02 16:19 ` Abhinav Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Abhinav Kumar @ 2022-05-02 16:19 UTC (permalink / raw)
To: Dmitry Baryshkov, Rob Clark, Sean Paul
Cc: kernel test robot, David Airlie, linux-arm-msm, dri-devel,
Stephen Boyd, Bjorn Andersson, freedreno
On 5/2/2022 1:24 AM, Dmitry Baryshkov wrote:
> Move the initializer for the mode variable to the declaration point to
> remove unitialized variable access from the DEBUG_DPU macro. This fixes
> the following warning:
>
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:250:37: note: initialize the variable 'mode' to silence this warning
>
> Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thanks,
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> index f4a79715a02e..4829d1ce0cf8 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
> @@ -247,7 +247,7 @@ static int dpu_encoder_phys_wb_atomic_check(
> struct drm_connector_state *conn_state)
> {
> struct drm_framebuffer *fb;
> - const struct drm_display_mode *mode;
> + const struct drm_display_mode *mode = &crtc_state->mode;
>
> DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
> phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
> @@ -256,7 +256,6 @@ static int dpu_encoder_phys_wb_atomic_check(
> return 0;
>
> fb = conn_state->writeback_job->fb;
> - mode = &crtc_state->mode;
>
> if (!conn_state || !conn_state->connector) {
> DPU_ERROR("invalid connector state\n");
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-02 16:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 8:24 [PATCH] drm/msm/dpu: don't access mode pointer before it is set Dmitry Baryshkov
2022-05-02 16:19 ` Abhinav Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).