summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGujulan Elango, Hari Prasath (H.) <hgujulan@visteon.com>2015-05-08 10:58:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 16:00:40 +0300
commitb68cecbedd5a66112b06ca22dce1ea06473b37b9 (patch)
tree0fb75117b53d9e507bd5c771b0a42d42a6ddecb3
parent94e057d7c4f01b1593773c7e8c5226cae23cf2c7 (diff)
downloadlinux-b68cecbedd5a66112b06ca22dce1ea06473b37b9.tar.xz
staging: rtl8192e: Use time_after macro
This patch replaces a condition check for time elapsed with a simple time_after macro Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8192e/rtl8192e/rtl_ps.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 0bbffec0c2ae..840dda962f90 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -28,6 +28,7 @@
#include "r8192E_phyreg.h"
#include "r8190P_rtl8256.h" /* RTL8225 Radio frontend */
#include "r8192E_cmdpkt.h"
+#include <linux/jiffies.h>
static void rtl8192_hw_sleep_down(struct net_device *dev)
{
@@ -93,6 +94,7 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
u32 tmp;
unsigned long flags;
+ unsigned long timeout;
spin_lock_irqsave(&priv->ps_lock, flags);
@@ -104,8 +106,8 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));
return;
}
-
- if ((time - jiffies) > msecs_to_jiffies(MAX_SLEEP_TIME)) {
+ timeout = jiffies + msecs_to_jiffies(MAX_SLEEP_TIME);
+ if (time_after((unsigned long)time, timeout)) {
netdev_info(dev, "========>too long to sleep:%lld > %ld\n",
time - jiffies, msecs_to_jiffies(MAX_SLEEP_TIME));
spin_unlock_irqrestore(&priv->ps_lock, flags);