2022-02-28 03:46:28

by 王擎

[permalink] [raw]
Subject: [PATCH] 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(-)

diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 6a142dc..76c6b4f
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -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;

/*
--
2.7.4


2022-02-28 17:42:09

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: wan: lmc: use time_is_before_jiffies() instead of open coding it

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <[email protected]>:

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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html