public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.
@ 2015-12-08 14:52 Maarten Lankhorst
  2015-12-10 10:18 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2015-12-08 14:52 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Joseph Yasi

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>
---
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b59a2d87b20e..06ba2bb36ce2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13686,13 +13686,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,
+		long lret;
+
+		lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
 							  false, true,
 							  MAX_SCHEDULE_TIMEOUT);
-		if (ret == -ERESTARTSYS)
-			return ret;
+		if (lret == -ERESTARTSYS)
+			return lret;
 
-		WARN_ON(ret < 0);
+		WARN(lret < 0, "waiting returns %li\n", lret);
 	}
 
 	if (!obj) {

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-10 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 14:52 [PATCH] drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long Maarten Lankhorst
2015-12-10 10:18 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox