drivers/net/hamradio/dmascc.c : Use of the
Subsystems (2)
PATCH 1/1 drivers/net/hamradio/dmascc.c : Use of the
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 <[email protected]>
drivers/net/hamradio/dmascc.c +5 -3
@@ -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 {
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors