public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Thomas Wood <thomas.wood@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] lib: fix signed/unsigned comparison issues
Date: Thu,  6 Feb 2014 16:31:54 +0000	[thread overview]
Message-ID: <1391704314-26068-1-git-send-email-thomas.wood@intel.com> (raw)

Store the result of set_vt_mode as a signed value so that errors can be
caught correctly.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_kms.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3960d24..5f341ff 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -620,15 +620,16 @@ static void restore_vt_mode_at_exit(int sig)
 
 void igt_set_vt_graphics_mode(void)
 {
+	long ret;
+
 	igt_install_exit_handler(restore_vt_mode_at_exit);
 
 	igt_disable_exit_handler();
-	orig_vt_mode = set_vt_mode(KD_GRAPHICS);
-	if (orig_vt_mode < 0)
-		orig_vt_mode = -1UL;
+	ret = set_vt_mode(KD_GRAPHICS);
 	igt_enable_exit_handler();
 
-	igt_assert(orig_vt_mode >= 0);
+	igt_assert(ret >= 0);
+	orig_vt_mode = ret;
 }
 
 int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
-- 
1.8.5.3

             reply	other threads:[~2014-02-06 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 16:31 Thomas Wood [this message]
2014-02-06 17:33 ` [PATCH i-g-t] lib: fix signed/unsigned comparison issues 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=1391704314-26068-1-git-send-email-thomas.wood@intel.com \
    --to=thomas.wood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox