From: Wang Qing Date: Mon, 28 Feb 2022 03:13:15 +0000 (-0800) Subject: net: ethernet: sun: use time_is_before_jiffies() instead of open coding it X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e0e8028cc0b8db4ece76c3dc9a8d1b6e03ab7d7a;p=linux.git net: ethernet: sun: use time_is_before_jiffies() instead of open coding it Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c index dba9f12efa1cf..947a76a788c7e 100644 --- a/drivers/net/ethernet/sun/cassini.c +++ b/drivers/net/ethernet/sun/cassini.c @@ -88,6 +88,7 @@ #include #include #include +#include #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.