[PATCH] staging: rtl8712e: use time_before() macro

Gujulan Elango, Hari Prasath (H.) hgujulan at visteon.com
Fri Apr 24 13:23:54 UTC 2015


This patch replaces the condition check for time elapsed with a
simplified time_before() macro

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan at visteon.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 602a189..88233cc 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -99,7 +99,7 @@ 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)) {
+	if (time_before(time, jiffies + msecs_to_jiffies(MIN_SLEEP_TIME))) {
 		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));
-- 
1.9.1


More information about the devel mailing list