Commit e0e8028c authored by Wang Qing's avatar Wang Qing Committed by David S. Miller

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: default avatarWang Qing <wangqing@vivo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b6cab7b
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/jiffies.h>
#define cas_page_map(x) kmap_atomic((x)) #define cas_page_map(x) kmap_atomic((x))
#define cas_page_unmap(x) kunmap_atomic((x)) #define cas_page_unmap(x) kunmap_atomic((x))
...@@ -4063,8 +4064,8 @@ static void cas_link_timer(struct timer_list *t) ...@@ -4063,8 +4064,8 @@ static void cas_link_timer(struct timer_list *t)
if (link_transition_timeout != 0 && if (link_transition_timeout != 0 &&
cp->link_transition_jiffies_valid && cp->link_transition_jiffies_valid &&
((jiffies - cp->link_transition_jiffies) > time_is_before_jiffies(cp->link_transition_jiffies +
(link_transition_timeout))) { link_transition_timeout)) {
/* One-second counter so link-down workaround doesn't /* One-second counter so link-down workaround doesn't
* cause resets to occur so fast as to fool the switch * cause resets to occur so fast as to fool the switch
* into thinking the link is down. * into thinking the link is down.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment