From patchwork Thu Feb 6 16:31:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 3596951 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB0D8BF418 for ; Thu, 6 Feb 2014 16:32:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1BCD20136 for ; Thu, 6 Feb 2014 16:32:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 43B9E2012F for ; Thu, 6 Feb 2014 16:32:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6076FB7FE; Thu, 6 Feb 2014 08:32:07 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 46330FB722 for ; Thu, 6 Feb 2014 08:32:00 -0800 (PST) Received: by mail-wi0-f174.google.com with SMTP id f8so1793086wiw.7 for ; Thu, 06 Feb 2014 08:31:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=PtqauTGfC7yA5zO6uHjJybW2tY3TkU72r4c6wkOo/Uc=; b=ROTFL+iAoFuH89U1AekzZUb2Y2b8H1847V3UOi8TMoWnJVQ4JdJygo1SHXVv53unps AD8lsds0FnHO1RF16RfEpMOzyACdMXugBq0ChZmyweHq3tOa4YuCARuwIz+Lq0+qDbzl SG7Fuc4ies1ubIrl4gARNzmXyn859l0bGov9F4mpWaqQU+tchOmN/Wg8Cik9F2BwqYRM kY23SWKsnCF04d0/neNptyyKiKLi+osk9GLqCE4Xw6sx+1m9CAT9H7QcSPpt10KA5VhY JLRyOl/i47fgBSpVR3K1ilM0eCfW5HtrpPUfXV4tE4wE29OZm0SBPWAcHVMCHW6OhYRA yfIQ== X-Gm-Message-State: ALoCoQkSaWjuVoooFSX5NeAGR0QW9Krj518DSlSGj7KQBeJsljF5/ARc+IAdlRm16v9DKlCR+8jO X-Received: by 10.194.143.40 with SMTP id sb8mr6676873wjb.15.1391704316888; Thu, 06 Feb 2014 08:31:56 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id gt6sm7065542wib.8.2014.02.06.08.31.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2014 08:31:56 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Feb 2014 16:31:54 +0000 Message-Id: <1391704314-26068-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.8.5.3 Subject: [Intel-gfx] [PATCH i-g-t] lib: fix signed/unsigned comparison issues X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Store the result of set_vt_mode as a signed value so that errors can be caught correctly. Signed-off-by: Thomas Wood --- 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,