Skip to contentSkip to conversation

net: ethernet: use time_is_before_eq_jiffies() instead of open coding it

PATCH Applied Qing Wang 2 participants 2 messages Feb 28, 2022

Subsystems (3)
lore
Share & tools
lore

Qing Wang

author
#0 lore raw

PATCH 1/1 net: ethernet: use time_is_before_eq_jiffies() instead of open coding it

From: Wang Qing <[email protected]>

Use the helper function time_is_{before,after}_jiffies() to improve code readability.

---
 drivers/net/ethernet/jme.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/jme.c +2 -1
index 439674f..b6c5122
@@ -28,6 +28,7 @@
 #include <linux/udp.h>
 #include <linux/if_vlan.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <net/ip6_checksum.h>
 #include "jme.h"
 
@@ -2179,7 +2180,7 @@ jme_stop_queue_if_full(struct jme_adapter *jme)
 	}
 
 	if (unlikely(txbi->start_xmit &&
-			(jiffies - txbi->start_xmit) >= TX_TIMEOUT &&
+			time_is_before_eq_jiffies(txbi->start_xmit + TX_TIMEOUT) &&
 			txbi->skb)) {
 		netif_stop_queue(jme->dev);
 		netif_info(jme, tx_queued, jme->dev,
Signature · 1 line
2.7.4
#1 lore raw
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:12:22 -0800 you wrote:

From: Wang Qing <[email protected]>

Use the helper function time_is_{before,after}_jiffies() to improve code readability.

[...]

Here is the summary with links:
- net: ethernet: use time_is_before_eq_jiffies() instead of open coding it

    https://git.kernel.org/netdev/net-next/c/882edc062168

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html