Skip to content

Commit

Permalink
net: decnet: use time_is_before_jiffies() instead of open coding it
Browse files Browse the repository at this point in the history
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wang Qing authored and davem330 committed Feb 28, 2022
1 parent b7eb7f6 commit 98fffd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/decnet/dn_nsp_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 98fffd7

Please sign in to comment.