All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Joseph Yasi <joe.yasi@gmail.com>
Subject: [PATCH] drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.
Date: Tue, 8 Dec 2015 15:52:56 +0100	[thread overview]
Message-ID: <5666EEC8.2000403@linux.intel.com> (raw)

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

             reply	other threads:[~2015-12-08 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 14:52 Maarten Lankhorst [this message]
2015-12-10 10:18 ` [PATCH] drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5666EEC8.2000403@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joe.yasi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.