diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2015-12-08 15:52:56 +0100 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-01-13 10:50:11 +0200 |
commit | de0513365cff619335a59417dea1d1ca665c2cfd (patch) | |
tree | a5a144119995b8e830b3c181dd820a6841de0002 /drivers/gpu | |
parent | 2dc2f761dea65069485110d24eaa5b0d5d808b07 (diff) | |
download | talos-obmc-linux-de0513365cff619335a59417dea1d1ca665c2cfd.tar.gz talos-obmc-linux-de0513365cff619335a59417dea1d1ca665c2cfd.zip |
drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.
This fixes a spurious warning from an integer overflow on 64-bits systems.
The function may return MAX_SCHEDULE_TIMEOUT which gets truncated to -1.
Explicitly handling this by casting to lret fixes it.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reported-and-tested-by: Joseph Yasi <joe.yasi@gmail.com>
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: drm-intel-fixes@lists.freedesktop.org
Fixes: 3c28ff22f6e20c ("i915: wait for fence in prepare_plane_fb")
Link: http://patchwork.freedesktop.org/patch/msgid/5666EEC8.2000403@linux.intel.com
(cherry picked from commit bcf8be279c79df6a8a17d9c3e1f9bc926444a87c)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 11af6f52b3e4..e5b0e932fbaa 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13765,13 +13765,15 @@ intel_prepare_plane_fb(struct drm_plane *plane, /* For framebuffer backed by dmabuf, wait for fence */ if (obj && obj->base.dma_buf) { - ret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv, - false, true, - MAX_SCHEDULE_TIMEOUT); - if (ret == -ERESTARTSYS) - return ret; + long lret; + + lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv, + false, true, + MAX_SCHEDULE_TIMEOUT); + if (lret == -ERESTARTSYS) + return lret; - WARN_ON(ret < 0); + WARN(lret < 0, "waiting returns %li\n", lret); } if (!obj) { |