* [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro
@ 2005-07-08 19:25 Marcelo Feitoza Parisi
2005-07-08 20:33 ` Marcelo Feitoza Parisi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-08 19:25 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 117 bytes --]
Use of the time_after() macro, defined at linux/jiffies.h, which deal
with wrapping correctly and are nicer to read.
[-- Attachment #2: ide-tape.patch --]
[-- Type: text/x-patch, Size: 774 bytes --]
Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
--- linux/drivers/ide/ide-tape.c 2005-07-07 19:13:15.000000000 -0300
+++ linux-kj/drivers/ide/ide-tape.c 2005-07-07 20:37:14.581539360 -0300
@@ -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 @@
}
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;
[-- Attachment #3: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro
2005-07-08 19:25 [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro Marcelo Feitoza Parisi
@ 2005-07-08 20:33 ` Marcelo Feitoza Parisi
2005-07-08 20:33 ` Alexey Dobriyan
2005-07-16 7:14 ` [KJ] [PATCH] drivers/ide/ide-tape.c : Use of the time_after() macro Marcelo Feitoza Parisi
2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-08 20:33 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 378 bytes --]
Alexey Dobriyan wrote:
> On Friday 08 July 2005 23:25, Marcelo Feitoza Parisi wrote:
>
>>Use of the time_after() macro, defined at linux/jiffies.h, which deal
>>with wrapping correctly and are nicer to read.
>
>
> OK, you're using Thunderbird, but at least include description of what patch
> does into attachment.
>
>
Re-sending patch, with description in the attachment.
[-- Attachment #2: ide-tape.patch --]
[-- Type: text/x-patch, Size: 892 bytes --]
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>
--- linux/drivers/ide/ide-tape.c 2005-07-07 19:13:15.000000000 -0300
+++ linux-kj/drivers/ide/ide-tape.c 2005-07-07 20:37:14.581539360 -0300
@@ -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 @@
}
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;
[-- Attachment #3: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro
2005-07-08 19:25 [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro Marcelo Feitoza Parisi
2005-07-08 20:33 ` Marcelo Feitoza Parisi
@ 2005-07-08 20:33 ` Alexey Dobriyan
2005-07-16 7:14 ` [KJ] [PATCH] drivers/ide/ide-tape.c : Use of the time_after() macro Marcelo Feitoza Parisi
2 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2005-07-08 20:33 UTC (permalink / raw)
To: kernel-janitors
On Friday 08 July 2005 23:25, Marcelo Feitoza Parisi wrote:
> Use of the time_after() macro, defined at linux/jiffies.h, which deal
> with wrapping correctly and are nicer to read.
OK, you're using Thunderbird, but at least include description of what patch
does into attachment.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* [KJ] [PATCH] drivers/ide/ide-tape.c : Use of the time_after() macro
2005-07-08 19:25 [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro Marcelo Feitoza Parisi
2005-07-08 20:33 ` Marcelo Feitoza Parisi
2005-07-08 20:33 ` Alexey Dobriyan
@ 2005-07-16 7:14 ` Marcelo Feitoza Parisi
2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-16 7:14 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: ide-tape.patch --]
[-- Type: text/x-patch, Size: 680 bytes --]
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>
--- linux/drivers/ide/ide-tape.c 2005-07-13 17:53:26.000000000 -0300
+++ linux-kj/drivers/ide/ide-tape.c 2005-07-14 15:11:05.561899880 -0300
@@ -2495,7 +2495,8 @@
} else {
return ide_do_reset(drive);
}
- } else if (jiffies - tape->dsc_polling_start > IDETAPE_DSC_MA_THRESHOLD)
+ } else if (time_after(jiffies, tape->dsc_polling_start
+ + IDETAPE_DSC_MA_THRESHOLD))
tape->dsc_polling_frequency = IDETAPE_DSC_MA_SLOW;
idetape_postpone_request(drive);
return ide_stopped;
[-- Attachment #3: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-07-16 7:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-08 19:25 [KJ] [PATCH] drivers/ide/ide-tape.c : Use of time_after macro Marcelo Feitoza Parisi
2005-07-08 20:33 ` Marcelo Feitoza Parisi
2005-07-08 20:33 ` Alexey Dobriyan
2005-07-16 7:14 ` [KJ] [PATCH] drivers/ide/ide-tape.c : Use of the time_after() macro Marcelo Feitoza Parisi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.