Skip to content

Commit

Permalink
net: rds: Use time_after() for time comparison
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_after() instead of raw math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Manuel Schölling authored and David S. Miller committed May 19, 2014
1 parent 03b8dcb commit 71fd762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions net/rds/ib_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
rds_ib_stats_inc(s_ib_tx_cq_event);

if (wc.wr_id == RDS_IB_ACK_WR_ID) {
if (ic->i_ack_queued + HZ/2 < jiffies)
if (time_after(jiffies, ic->i_ack_queued + HZ/2))
rds_ib_stats_inc(s_ib_tx_stalled);
rds_ib_ack_send_complete(ic);
continue;
Expand All @@ -315,7 +315,7 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)

rm = rds_ib_send_unmap_op(ic, send, wc.status);

if (send->s_queued + HZ/2 < jiffies)
if (time_after(jiffies, send->s_queued + HZ/2))
rds_ib_stats_inc(s_ib_tx_stalled);

if (send->s_op) {
Expand Down
4 changes: 2 additions & 2 deletions net/rds/iw_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
}

if (wc.wr_id == RDS_IW_ACK_WR_ID) {
if (ic->i_ack_queued + HZ/2 < jiffies)
if (time_after(jiffies, ic->i_ack_queued + HZ/2))
rds_iw_stats_inc(s_iw_tx_stalled);
rds_iw_ack_send_complete(ic);
continue;
Expand Down Expand Up @@ -267,7 +267,7 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)

send->s_wr.opcode = 0xdead;
send->s_wr.num_sge = 1;
if (send->s_queued + HZ/2 < jiffies)
if (time_after(jiffies, send->s_queued + HZ/2))
rds_iw_stats_inc(s_iw_tx_stalled);

/* If a RDMA operation produced an error, signal this right
Expand Down

0 comments on commit 71fd762

Please sign in to comment.