net: wan: lmc: use time_is_before_jiffies() instead of open coding it
Subsystems (2)
PATCH 1/1 net: wan: lmc: use time_is_before_jiffies() instead of open coding it
From: Wang Qing <[email protected]>
Use the helper function time_is_{before,after}_jiffies() to improve code readability.
Signed-off-by Wang Qing <[email protected]>
--- drivers/net/wan/lmc/lmc_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wan/lmc/lmc_main.c +2 -1
@@ -57,6 +57,7 @@#include <asm/io.h> #include <asm/dma.h> #include <linux/uaccess.h> +#include <linux/jiffies.h> //#include <asm/spinlock.h> #define DRIVER_MAJOR_VERSION 1
@@ -1968,7 +1969,7 @@ static void lmc_driver_timeout(struct net_device *dev, unsigned int txqueue)printk ("%s: Xmitter busy|\n" , dev->name); sc->extra_stats.tx_tbusy_calls++; -if (jiffies -dev_trans_start (dev) <TX_TIMEOUT ) +if (time_is_before_jiffies (dev_trans_start (dev) +TX_TIMEOUT )) goto bug_out;/*
Signature · 1 line
2.7.4
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Sun, 27 Feb 2022 19:13:48 -0800 you wrote:
From: Wang Qing <[email protected]>
Use the helper function time_is_{before,after}_jiffies() to improve code readability.
Signed-off-by Wang Qing <[email protected]>[...]
Here is the summary with links:
- net: wan: lmc: use time_is_before_jiffies() instead of open coding it
https://git.kernel.org/netdev/net-next/c/b7eb7f67eb29
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html