From 6fccbdfd9a012e0ba2228eb84c5c577ed3c13822 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 26 Oct 2011 19:32:58 +0000 Subject: [PATCH] Fix incorrect handling of jiffies wrap around as pointed out by Bart Van Assche. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3901 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 874b02313..18a5f9f08 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -795,11 +795,7 @@ int scst_suspend_activity(unsigned long timeout) scst_get_cmd_counter()); if (timeout != SCST_SUSPEND_TIMEOUT_UNLIMITED) { - unsigned long cur_time1 = jiffies; - if (cur_time1 >= cur_time) - wait_time = cur_time1 - cur_time; - else - wait_time = cur_time - cur_time1; + wait_time = jiffies - cur_time; /* just in case */ if (wait_time >= timeout) { res = -EBUSY;