From: Robert P. J. Day Date: Thu, 17 Apr 2008 04:09:28 +0000 (-0700) Subject: IB/ipath: Fix time comparison to use time_after_eq() X-Git-Tag: v2.6.26-rc1~1156^2~41 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b3b8128fd3b0966830ee90f1162173d07cb496a0;p=linux-2.6-omap-h63xx.git IB/ipath: Fix time comparison to use time_after_eq() Raw comparison against jiffies will fail if jiffies wraps, although since ipath currently only supports 64-bit architectures, this is rather far-fetched. Still, it's better to use time_after_eq(). Signed-off-by: Robert P. J. Day Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c index 30b2f44406b..babcc09c832 100644 --- a/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/drivers/infiniband/hw/ipath/ipath_mad.c @@ -1397,7 +1397,8 @@ static int process_subn(struct ib_device *ibdev, int mad_flags, } /* Is the mkey in the process of expiring? */ - if (dev->mkey_lease_timeout && jiffies >= dev->mkey_lease_timeout) { + if (dev->mkey_lease_timeout && + time_after_eq(jiffies, dev->mkey_lease_timeout)) { /* Clear timeout and mkey protection field. */ dev->mkey_lease_timeout = 0; dev->mkeyprot = 0;