Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: rds: Use time_after() for time comparison

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>

authored by

Manuel Schölling and committed by
David S. Miller
71fd762f 03b8dcba

+4 -4
+2 -2
net/rds/ib_send.c
··· 298 298 rds_ib_stats_inc(s_ib_tx_cq_event); 299 299 300 300 if (wc.wr_id == RDS_IB_ACK_WR_ID) { 301 - if (ic->i_ack_queued + HZ/2 < jiffies) 301 + if (time_after(jiffies, ic->i_ack_queued + HZ/2)) 302 302 rds_ib_stats_inc(s_ib_tx_stalled); 303 303 rds_ib_ack_send_complete(ic); 304 304 continue; ··· 315 315 316 316 rm = rds_ib_send_unmap_op(ic, send, wc.status); 317 317 318 - if (send->s_queued + HZ/2 < jiffies) 318 + if (time_after(jiffies, send->s_queued + HZ/2)) 319 319 rds_ib_stats_inc(s_ib_tx_stalled); 320 320 321 321 if (send->s_op) {
+2 -2
net/rds/iw_send.c
··· 232 232 } 233 233 234 234 if (wc.wr_id == RDS_IW_ACK_WR_ID) { 235 - if (ic->i_ack_queued + HZ/2 < jiffies) 235 + if (time_after(jiffies, ic->i_ack_queued + HZ/2)) 236 236 rds_iw_stats_inc(s_iw_tx_stalled); 237 237 rds_iw_ack_send_complete(ic); 238 238 continue; ··· 267 267 268 268 send->s_wr.opcode = 0xdead; 269 269 send->s_wr.num_sge = 1; 270 - if (send->s_queued + HZ/2 < jiffies) 270 + if (time_after(jiffies, send->s_queued + HZ/2)) 271 271 rds_iw_stats_inc(s_iw_tx_stalled); 272 272 273 273 /* If a RDMA operation produced an error, signal this right