* [PATCH i-g-t] lib: fix signed/unsigned comparison issues
@ 2014-02-06 16:31 Thomas Wood
2014-02-06 17:33 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Wood @ 2014-02-06 16:31 UTC (permalink / raw)
To: intel-gfx
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH i-g-t] lib: fix signed/unsigned comparison issues
2014-02-06 16:31 [PATCH i-g-t] lib: fix signed/unsigned comparison issues Thomas Wood
@ 2014-02-06 17:33 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2014-02-06 17:33 UTC (permalink / raw)
To: Thomas Wood; +Cc: intel-gfx
On Thu, Feb 06, 2014 at 04:31:54PM +0000, Thomas Wood wrote:
> 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>
Both merged, thanks.
-Daniel
> ---
> 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
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-06 17:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-06 16:31 [PATCH i-g-t] lib: fix signed/unsigned comparison issues Thomas Wood
2014-02-06 17:33 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox