drm/atomic: Initialize variables in drm_atomic_helper_async_check() to make gcc happy
Subsystems (2)
PATCH 1/1 drm/atomic: Initialize variables in drm_atomic_helper_async_check() to make gcc happy
drm_atomic_helper_async_check() declares the plane, old_plane_state and new_plane_state variables to iterate over all planes of the atomic state and make sure only one plane is enabled.
Unfortunately gcc is not smart enough to figure out that the check on n_planes is enough to guarantee that plane, new_plane_state and old_plane_state are initialized.
Explicitly initialized those variables to NULL to make gcc happy.
--- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +3 -2
@@ -1538,8 +1538,9 @@ int drm_atomic_helper_async_check(struct drm_device *dev, {struct drm_crtc *crtc;struct drm_crtc_state *crtc_state; -struct drm_plane *plane; -struct drm_plane_state *old_plane_state, *new_plane_state; +struct drm_plane *plane =NULL ; +struct drm_plane_state *old_plane_state =NULL ; +struct drm_plane_state *new_plane_state =NULL ;const struct drm_plane_helper_funcs *funcs;int i, n_planes =0 ;
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Boris Brezillon
drm_atomic_helper_async_check()declares the plane,old_plane_stateandnew_plane_statevariables to iterate over all planes of the atomic state and make sure only one plane is enabled.Unfortunately gcc is not smart enough to figure out that the check on
n_planesis enough to guarantee that plane,new_plane_stateandold_plane_stateare initialized.Explicitly initialized those variables to NULL to make gcc happy.
Quoted 30 lines
Fixes fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic_helper.c +3
-2@@ -1538,8 +1538,9 @@ int drm_atomic_helper_async_check(struct drm_device *dev, {struct drm_crtc *crtc;struct drm_crtc_state *crtc_state; -struct drm_plane *plane; -struct drm_plane_state *old_plane_state, *new_plane_state; +struct drm_plane *plane =NULL ; +struct drm_plane_state *old_plane_state =NULL ; +struct drm_plane_state *new_plane_state =NULL ;const struct drm_plane_helper_funcs *funcs;int i, n_planes =0 ;Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 10 lines · On Mon, 23 Jul 2018 10:09:25 -0400 Sean Paul <[email protected]> wrote:
Quoted 9 lines · Boris Brezillon
drm_atomic_helper_async_check()declares the plane,old_plane_stateandnew_plane_statevariables to iterate over all planes of the atomic state and make sure only one plane is enabled.Unfortunately gcc is not smart enough to figure out that the check on
n_planesis enough to guarantee that plane,new_plane_stateandold_plane_stateare initialized.Explicitly initialized those variables to NULL to make gcc happy.
^ initialize
And I forgot to add
Will send a v2 soon.
Quoted 2 lines
Reviewed-by Sean Paul <[email protected]>
Thanks for the review.
Quoted 24 lines
Quoted 24 lines
Fixes fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic_helper.c +3
-2@@ -1538,8 +1538,9 @@ int drm_atomic_helper_async_check(struct drm_device *dev, {struct drm_crtc *crtc;struct drm_crtc_state *crtc_state; -struct drm_plane *plane; -struct drm_plane_state *old_plane_state, *new_plane_state; +struct drm_plane *plane =NULL ; +struct drm_plane_state *old_plane_state =NULL ; +struct drm_plane_state *new_plane_state =NULL ;const struct drm_plane_helper_funcs *funcs;int i, n_planes =0 ;
Quoted 8 lines
Quoted 7 lines
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel