Skip to contentSkip to conversation

net: ethernet: sun: use time_is_before_jiffies() instead of open coding it

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

Subsystems (2)
lore
Share & tools
lore

Qing Wang

author
#0 lore raw

PATCH 1/1 net: ethernet: sun: 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.

---
 drivers/net/ethernet/sun/cassini.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/sun/cassini.c +3 -2
index dba9f12..947a76a
@@ -88,6 +88,7 @@
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/uaccess.h>
+#include <linux/jiffies.h>
 
 #define cas_page_map(x)      kmap_atomic((x))
 #define cas_page_unmap(x)    kunmap_atomic((x))
@@ -4063,8 +4064,8 @@ static void cas_link_timer(struct timer_list *t)
 
 	if (link_transition_timeout != 0 &&
 	    cp->link_transition_jiffies_valid &&
-	    ((jiffies - cp->link_transition_jiffies) >
-	      (link_transition_timeout))) {
+	    time_is_before_jiffies(cp->link_transition_jiffies +
+	      link_transition_timeout)) {
 		/* One-second counter so link-down workaround doesn't
 		 * cause resets to occur so fast as to fool the switch
 		 * into thinking the link is down.
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:13:15 -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: sun: use time_is_before_jiffies() instead of open coding it

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

You are awesome, thank you!

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