Skip to contentSkip to conversation

net: decnet: use time_is_before_jiffies() instead of open coding it

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

Subsystems (2)

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore

Qing Wang

author
#0 lore raw

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

---
 net/decnet/dn_nsp_out.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/decnet/dn_nsp_out.c +2 -1
index eadc895..b05639b
@@ -52,6 +52,7 @@
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/if_packet.h>
+#include <linux/jiffies.h>
 #include <net/neighbour.h>
 #include <net/dst.h>
 #include <net/flow.h>
@@ -351,7 +352,7 @@ void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb,
 	 * Slow start: If we have been idle for more than
 	 * one RTT, then reset window to min size.
 	 */
-	if ((jiffies - scp->stamp) > t)
+	if (time_is_before_jiffies(scp->stamp + t))
 		scp->snd_window = NSP_MIN_WINDOW;
 
 	if (oth)
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:15:55 -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: decnet: use time_is_before_jiffies() instead of open coding it

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

You are awesome, thank you!

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