Skip to content

Commit

Permalink
IB/ipath: Fix time comparison to use time_after_eq()
Browse files Browse the repository at this point in the history
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 <rpjday@crashcourse.ca>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Robert P. J. Day authored and Roland Dreier committed Apr 17, 2008
1 parent f438000 commit b3b8128
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/ipath/ipath_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3b8128

Please sign in to comment.