Linux ATA/IDE development
 help / color / mirror / Atom feed
From: domen@coderock.org
To: gadio@netvision.net.il
Cc: B.Zolnierkiewicz@elka.pw.edu.pl, linux-ide@vger.kernel.org,
	Marcelo Feitoza Parisi <marcelo@feitoza.com.br>,
	domen@coderock.org
Subject: [patch 1/1] drivers/ide/ide-tape.c : Use of time_after macro
Date: Fri, 15 Jul 2005 00:21:12 +0200	[thread overview]
Message-ID: <20050714222111.777320000@homer> (raw)

[-- 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;

--

                 reply	other threads:[~2005-07-14 22:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050714222111.777320000@homer \
    --to=domen@coderock.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=gadio@netvision.net.il \
    --cc=linux-ide@vger.kernel.org \
    --cc=marcelo@feitoza.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox