public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source()
@ 2021-10-26 14:24 Nathan Chancellor
  2021-10-27 16:07 ` Jessica Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2021-10-26 14:24 UTC (permalink / raw)
  To: Rob Clark, Sean Paul
  Cc: Nick Desaulniers, Jessica Zhang, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, llvm, Nathan Chancellor,
	kernelci.org bot

Clang warns:

drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:162:6: error: variable 'commit' is uninitialized when used here [-Werror,-Wuninitialized]
        if (commit)
            ^~~~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:106:32: note: initialize the variable 'commit' to silence this warning
        struct drm_crtc_commit *commit;
                                      ^
                                       = NULL
1 error generated.

The assignment and use of commit in the main body of
dpu_crtc_set_crc_source() were removed from v1 to v2 but the call to
drm_crtc_commit_put() at the end was not. Do that now so there is no
more warning.

Fixes: 78d9b458cc21 ("drm/msm/dpu: Add CRC support for DPU")
Link: https://github.com/ClangBuiltLinux/linux/issues/1493
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 2523e829f485..967245b8cc02 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -103,7 +103,6 @@ static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
 {
 	enum dpu_crtc_crc_source source = dpu_crtc_parse_crc_source(src_name);
 	enum dpu_crtc_crc_source current_source;
-	struct drm_crtc_commit *commit;
 	struct dpu_crtc_state *crtc_state;
 	struct drm_device *drm_dev = crtc->dev;
 	struct dpu_crtc_mixer *m;
@@ -159,8 +158,6 @@ static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
 
 
 cleanup:
-	if (commit)
-		drm_crtc_commit_put(commit);
 	drm_modeset_unlock(&crtc->mutex);
 
 	return ret;

base-commit: 00326bfa4e6363e4b0b8b019ecd2556fdda5ad1c
-- 
2.33.1.637.gf443b226ca


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source()
  2021-10-26 14:24 [PATCH] drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source() Nathan Chancellor
@ 2021-10-27 16:07 ` Jessica Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Jessica Zhang @ 2021-10-27 16:07 UTC (permalink / raw)
  To: Nathan Chancellor, Rob Clark, Sean Paul
  Cc: Nick Desaulniers, Jessica Zhang, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, llvm, kernelci.org bot

On 10/26/2021 7:24 AM, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:162:6: error: variable 'commit' is uninitialized when used here [-Werror,-Wuninitialized]
>          if (commit)
>              ^~~~~~
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c:106:32: note: initialize the variable 'commit' to silence this warning
>          struct drm_crtc_commit *commit;
>                                        ^
>                                         = NULL
> 1 error generated.
>
> The assignment and use of commit in the main body of
> dpu_crtc_set_crc_source() were removed from v1 to v2 but the call to
> drm_crtc_commit_put() at the end was not. Do that now so there is no
> more warning.
>
> Fixes: 78d9b458cc21 ("drm/msm/dpu: Add CRC support for DPU")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1493
> Reported-by: "kernelci.org bot" <bot@kernelci.org>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 2523e829f485..967245b8cc02 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -103,7 +103,6 @@ static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
>   {
>   	enum dpu_crtc_crc_source source = dpu_crtc_parse_crc_source(src_name);
>   	enum dpu_crtc_crc_source current_source;
> -	struct drm_crtc_commit *commit;
>   	struct dpu_crtc_state *crtc_state;
>   	struct drm_device *drm_dev = crtc->dev;
>   	struct dpu_crtc_mixer *m;
> @@ -159,8 +158,6 @@ static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
>   
>   
>   cleanup:
> -	if (commit)
> -		drm_crtc_commit_put(commit);
>   	drm_modeset_unlock(&crtc->mutex);
>   
>   	return ret;
>
> base-commit: 00326bfa4e6363e4b0b8b019ecd2556fdda5ad1c

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-27 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-26 14:24 [PATCH] drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source() Nathan Chancellor
2021-10-27 16:07 ` Jessica Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox