drm: Fix compiler warning in drm_atomic_helper.c
Subsystems (2)
PATCH 1/1 drm: Fix compiler warning in drm_atomic_helper.c
From: Sean Paul <[email protected]>
Kbuild was complaining about:
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/drm_atomic_helper.c:3169:27: warning: 'state' may be used uninitialized in this function [-Wmaybe-uninitialized]
Now state can't actually be used uninitialized, but we'll assign a value anyways so it stops bellyaching.
--- drivers/gpu/drm/drm_atomic_helper.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +3 -0
@@ -3169,6 +3169,9 @@ struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev)struct drm_atomic_state *state;int err; +/* This can never be returned, but it makes the compiler happy */ + state =ERR_PTR (-EINVAL ); +DRM_MODESET_LOCK_ALL_BEGIN (dev, ctx,0 , err); state =drm_atomic_helper_duplicate_state (dev, &ctx);
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Sean Paul
From: Sean Paul <[email protected]>
Kbuildwas complaining about:Quoted 1 line
Quoted 1 line
drivers/gpu/drm/drm_atomic_helper.c:3169:27: warning: 'state' may be used uninitialized in this function [-Wmaybe-uninitialized]Now state can't actually be used uninitialized, but we'll assign a value anyways so it stops bellyaching.
Quoted 9 lines
Fixes b7ea04d299c7 ("drm: Add DRM_MODESET_LOCK_BEGIN/END helpers")Cc Daniel Vetter <[email protected]>Cc Sean Paul <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Signed-off-by Sean Paul <[email protected]>
Quoted 21 lines
--- drivers/gpu/drm/drm_atomic_helper.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_atomic_helper.c +3
-0@@ -3169,6 +3169,9 @@ struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev)struct drm_atomic_state *state;int err; +/* This can never be returned, but it makes the compiler happy */ + state =ERR_PTR (-EINVAL ); +DRM_MODESET_LOCK_ALL_BEGIN (dev, ctx,0 , err); state =drm_atomic_helper_duplicate_state (dev, &ctx);Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 20 lines · Daniel Vetter
Quoted 8 lines · Sean Paul
From: Sean Paul <[email protected]>
Kbuildwas complaining about:Quoted 1 line
Quoted 1 line
drivers/gpu/drm/drm_atomic_helper.c:3169:27: warning: 'state' may be used uninitialized in this function [-Wmaybe-uninitialized]Now state can't actually be used uninitialized, but we'll assign a value anyways so it stops bellyaching.
Quoted 9 lines
Fixes b7ea04d299c7 ("drm: Add DRM_MODESET_LOCK_BEGIN/END helpers")Cc Daniel Vetter <[email protected]>Cc Sean Paul <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Signed-off-by Sean Paul <[email protected]>
Quoted 2 lines
Reviewed-by Daniel Vetter <[email protected]>
Thanks for the review, I've pushed it to drm-misc-next with a more detailed commit message including kbuild link/configuration (upon Dave's suggestion).
Sean
Quoted 17 lines
Quoted 17 lines
--- drivers/gpu/drm/drm_atomic_helper.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_atomic_helper.c +3
-0@@ -3169,6 +3169,9 @@ struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev)struct drm_atomic_state *state;int err; +/* This can never be returned, but it makes the compiler happy */ + state =ERR_PTR (-EINVAL ); +DRM_MODESET_LOCK_ALL_BEGIN (dev, ctx,0 , err);
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/drm_atomic_helper.c +0
-1state =drm_atomic_helper_duplicate_state (dev, &ctx); --Sean Paul, Software Engineer, Google / Chromium OS
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel