summaryrefslogtreecommitdiff
path: root/drivers/net/hamradio
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2022-02-28 06:13:31 +0300
committerDavid S. Miller <davem@davemloft.net>2022-02-28 16:21:31 +0300
commit61c4fb9c4d09dfb6f33690169560862d5d0e42f7 (patch)
tree402e94189229f1adb2d2b3fd0b3e1b9473472cb1 /drivers/net/hamradio
parente0e8028cc0b8db4ece76c3dc9a8d1b6e03ab7d7a (diff)
downloadlinux-61c4fb9c4d09dfb6f33690169560862d5d0e42f7.tar.xz
net: hamradio: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hamradio')
-rw-r--r--drivers/net/hamradio/dmascc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index 7e527499d3ad..6e7d17a75972 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -28,6 +28,7 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>
+#include <linux/jiffies.h>
#include <net/ax25.h>
#include "z8530.h"
@@ -377,7 +378,7 @@ static int __init dmascc_init(void)
udelay(2000000 / TMR_0_HZ);
/* Timing loop */
- while (jiffies - time < 13) {
+ while (time_is_after_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 */
@@ -525,7 +526,7 @@ static int __init setup_adapter(int card_base, int type, int n)
/* Wait and detect IRQ */
time = jiffies;
- while (jiffies - time < 2 + HZ / TMR_0_HZ);
+ while (time_is_after_jiffies(time + 2 + HZ / TMR_0_HZ));
irq = probe_irq_off(irqs);
/* Clear pending interrupt, disable interrupts */
@@ -1353,7 +1354,7 @@ static void es_isr(struct scc_priv *priv)
/* Switch state */
write_scc(priv, R15, 0);
if (priv->tx_count &&
- (jiffies - priv->tx_start) < priv->param.txtimeout) {
+ time_is_after_jiffies(priv->tx_start + priv->param.txtimeout) {
priv->state = TX_PAUSE;
start_timer(priv, priv->param.txpause, 0);
} else {