Skip to content

Commit

Permalink
ioat: Use time_before_jiffies()
Browse files Browse the repository at this point in the history
To be future-proof and for better readability the time comparisons are modified
to use time_before_jiffies() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
[djbw: use time_before_jiffies() to make argument order more clear]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Manuel Schölling authored and Dan Williams committed Aug 21, 2014
1 parent 87cea76 commit e628ce7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/dma/ioat/dma_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs)
* called under bh_disabled so we need to trigger the timer
* event directly
*/
if (jiffies > chan->timer.expires && timer_pending(&chan->timer)) {
if (time_is_before_jiffies(chan->timer.expires)
&& timer_pending(&chan->timer)) {
struct ioatdma_device *device = chan->device;

mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
Expand Down

0 comments on commit e628ce7

Please sign in to comment.