* [KJ] [PATCH] drivers/net/hamradio/dmascc.c : Use of the
@ 2005-07-16 7:06 Marcelo Feitoza Parisi
0 siblings, 0 replies; only message in thread
From: Marcelo Feitoza Parisi @ 2005-07-16 7:06 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: dmascc.patch --]
[-- Type: text/x-patch, Size: 1409 bytes --]
Use of the time_before() 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/net/hamradio/dmascc.c 2005-06-17 16:48:29.000000000 -0300
+++ linux-kj/drivers/net/hamradio/dmascc.c 2005-07-16 03:52:00.470502312 -0300
@@ -34,6 +34,7 @@
#include <linux/rtnetlink.h>
#include <linux/sockios.h>
#include <linux/workqueue.h>
+#include <linux/jiffies.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
#include <asm/dma.h>
@@ -405,7 +406,7 @@
udelay(2000000 / TMR_0_HZ);
/* Timing loop */
- while (jiffies - time < 13) {
+ while (time_before(jiffies, time + 13)) {
for (i = 0; i < hw[h].num_devs; i++)
if (base[i] && counting[i]) {
/* Read back Timer 1: latch; read LSB; read MSB */
@@ -548,7 +549,7 @@
/* Wait and detect IRQ */
time = jiffies;
- while (jiffies - time < 2 + HZ / TMR_0_HZ);
+ while (time_before(jiffies, time + 2 + HZ / TMR_0_HZ));
irq = probe_irq_off(irqs);
/* Clear pending interrupt, disable interrupts */
@@ -1395,7 +1396,8 @@
/* Switch state */
write_scc(priv, R15, 0);
if (priv->tx_count &&
- (jiffies - priv->tx_start) < priv->param.txtimeout) {
+ time_before(jiffies, priv->tx_start
+ + priv->param.txtimeout)) {
priv->state = TX_PAUSE;
start_timer(priv, priv->param.txpause, 0);
} else {
[-- 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] only message in thread
only message in thread, other threads:[~2005-07-16 7:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16 7:06 [KJ] [PATCH] drivers/net/hamradio/dmascc.c : Use of the 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.