* [patch 1/1] drivers/ide/ide-tape.c : Use of time_after macro
@ 2005-07-14 22:21 domen
0 siblings, 0 replies; only message in thread
From: domen @ 2005-07-14 22:21 UTC (permalink / raw)
To: gadio; +Cc: B.Zolnierkiewicz, linux-ide, Marcelo Feitoza Parisi, domen
[-- Attachment #1: time_after-drivers_ide_ide-tape --]
[-- Type: text/plain, Size: 1153 bytes --]
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
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 <marcelo@feitoza.com.br>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
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;
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-07-14 22:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-14 22:21 [patch 1/1] drivers/ide/ide-tape.c : Use of time_after macro domen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).