From: Gujulan Elango, Hari Prasath (H.) Date: Fri, 8 May 2015 11:04:43 +0000 (+0000) Subject: staging: rtl8192e: use time_before() macro X-Git-Tag: v5.15~15549^2~642 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e32e1928146662d1cb7c4dc4385dcdcb0357340e;p=platform%2Fkernel%2Flinux-starfive.git staging: rtl8192e: use time_before() macro This patch replaces the condition check for time elapsed with a simplified time_before() macro Signed-off-by: Hari Prasath Gujulan Elango Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index 840dda9..386ae0c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -100,7 +100,8 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time) time -= msecs_to_jiffies(8 + 16 + 7); - if ((time - jiffies) <= msecs_to_jiffies(MIN_SLEEP_TIME)) { + timeout = jiffies + msecs_to_jiffies(MIN_SLEEP_TIME); + if (time_before((unsigned long)time,timeout)) { spin_unlock_irqrestore(&priv->ps_lock, flags); netdev_info(dev, "too short to sleep::%lld < %ld\n", time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));