aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Paul <[email protected]>2018-11-29 15:36:48 -0500
committerSean Paul <[email protected]>2018-11-30 10:01:34 -0500
commit615aa3d9aee28806f947cd1d99f1fd1f9b3e35b6 (patch)
treebb47af48fa527fb3294992be8105d1082ab2cb0c
parentf6d266c279c01708c2937849bae57210af952fa2 (diff)
drm: Fix compiler warning in drm_atomic_helper.c
Kbuild was complaining about: >> 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. Kbuild config: link: https://lists.01.org/pipermail/kbuild-all/2018-November/055374.html tree: git://anongit.freedesktop.org/drm/drm-misc for-linux-next head: b7ea04d299c78b6cf96ab281a1683ff62a74f969 commit: b7ea04d299c78b6cf96ab281a1683ff62a74f969 [4/4] drm: Add DRM_MODESET_LOCK_BEGIN/END helpers config: x86_64-randconfig-x017-201847 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout b7ea04d299c78b6cf96ab281a1683ff62a74f969 # save the attached .config to linux build tree make ARCH=x86_64 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]> Cc: [email protected] Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Sean Paul <[email protected]> [seanpaul added extra details on airlied's suggestion] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 0d58c40aa440..0ee83efeb94a 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -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);