Skip to contentSkip to conversation

drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source()

PATCH In review Nathan Chancellor 2 participants 2 messages Oct 26, 2021 – Oct 27, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/dpu: Remove commit and its uses in dpu_crtc_set_crc_source()

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")
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +0 -3
index 2523e829f485..967245b8cc02 100644
@@ -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

Signature · 1 line
2.33.1.637.gf443b226ca
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Nathan Chancellor

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.

Quoted 4 lines
Fixes 78d9b458cc21 ("drm/msm/dpu: Add CRC support for DPU")
Quoted 27 lines
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +0 -3
index 2523e829f485..967245b8cc02 100644
@@ -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