From: Marcelo Feitoza Parisi <[EMAIL PROTECTED]>
Use of the time_after() macro, defined at linux/jiffies.h, which deal
with wrapping correctly and are nicer to read.
Signed-off-by: Marcelo Feitoza Parisi <[EMAIL PROTECTED]>
Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>
---
ide-tape.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: quilt/drivers/ide/ide-tape.c
===================================================================
--- quilt.orig/drivers/ide/ide-tape.c
+++ quilt/drivers/ide/ide-tape.c
@@ -443,6 +443,7 @@
#include <linux/smp_lock.h>
#include <linux/completion.h>
#include <linux/bitops.h>
+#include <linux/jiffies.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -2333,7 +2334,7 @@ static ide_startstop_t idetape_rw_callba
}
if (time_after(jiffies, tape->insert_time))
tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies -
tape->insert_time);
- if (jiffies - tape->avg_time >= HZ) {
+ if (time_after_eq(jiffies, tape->avg_time + HZ)) {
tape->avg_speed = tape->avg_size * HZ / (jiffies -
tape->avg_time) / 1024;
tape->avg_size = 0;
tape->avg_time = jiffies;
--
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html