aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sun
diff options
context:
space:
mode:
authorWang Qing2022-02-27 19:13:15 -0800
committerDavid S. Miller2022-02-28 13:21:31 +0000
commite0e8028cc0b8db4ece76c3dc9a8d1b6e03ab7d7a (patch)
tree41ca06170e29dd93b2e17e7485b679af59a06a0d /drivers/net/ethernet/sun
parent3b6cab7b5a2feed11f3d6ad90e0ad8ea03f87670 (diff)
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 <wangqing@vivo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun')
-rw-r--r--drivers/net/ethernet/sun/cassini.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index dba9f12efa1c..947a76a788c7 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -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.