aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-12-04 09:44:23 -0500
committerRob Clark <robdclark@gmail.com>2017-12-13 11:11:55 -0500
commita1ed6def4410451eeb2ce85b4270e6fe9d3c902c (patch)
treec014e2307eaa51c132ec72466009980c6fbcea1f
parent8dcbde0f230594eada5646191bdb4a29be1876f6 (diff)
drm/msm: avoid false-positive -Wmaybe-uninitialized warning
gcc-8 -fsanitize-coverage=trace-pc produces a false-positive warning: drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set.isra.8': drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:1053:3: error: 'crtc_x_r' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's relatively clear from reading the source that this cannot happen, and older compilers get it right. This rearranges the code remove the two affected variables, which reliably avoids the problem. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index ee41423baeb7..29678876fc09 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -966,8 +966,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
966 uint32_t src_x, src_y; 966 uint32_t src_x, src_y;
967 uint32_t src_w, src_h; 967 uint32_t src_w, src_h;
968 uint32_t src_img_w, src_img_h; 968 uint32_t src_img_w, src_img_h;
969 uint32_t src_x_r;
970 int crtc_x_r;
971 int ret; 969 int ret;
972 970
973 nplanes = fb->format->num_planes; 971 nplanes = fb->format->num_planes;
@@ -1012,9 +1010,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
1012 crtc_w /= 2; 1010 crtc_w /= 2;
1013 src_w /= 2; 1011 src_w /= 2;
1014 src_img_w /= 2; 1012 src_img_w /= 2;
1015
1016 crtc_x_r = crtc_x + crtc_w;
1017 src_x_r = src_x + src_w;
1018 } 1013 }
1019 1014
1020 ret = calc_scalex_steps(plane, pix_format, src_w, crtc_w, step.x); 1015 ret = calc_scalex_steps(plane, pix_format, src_w, crtc_w, step.x);
@@ -1054,9 +1049,9 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
1054 if (right_hwpipe) 1049 if (right_hwpipe)
1055 mdp5_hwpipe_mode_set(mdp5_kms, right_hwpipe, fb, &step, &pe, 1050 mdp5_hwpipe_mode_set(mdp5_kms, right_hwpipe, fb, &step, &pe,
1056 config, hdecm, vdecm, hflip, vflip, 1051 config, hdecm, vdecm, hflip, vflip,
1057 crtc_x_r, crtc_y, crtc_w, crtc_h, 1052 crtc_x + crtc_w, crtc_y, crtc_w, crtc_h,
1058 src_img_w, src_img_h, 1053 src_img_w, src_img_h,
1059 src_x_r, src_y, src_w, src_h); 1054 src_x + src_w, src_y, src_w, src_h);
1060 1055
1061 plane->fb = fb; 1056 plane->fb = fb;
1062 1057