Skip to content

Commit

Permalink
vxge: Use time_before()
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() instead of plain, error-prone 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 21, 2014
1 parent 12b5c38 commit f6e92d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/neterion/vxge/vxge-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ static int vxge_open_vpaths(struct vxgedev *vdev)
static void adaptive_coalesce_tx_interrupts(struct vxge_fifo *fifo)
{
fifo->interrupt_count++;
if (jiffies > fifo->jiffies + HZ / 100) {
if (time_before(fifo->jiffies + HZ / 100, jiffies)) {
struct __vxge_hw_fifo *hw_fifo = fifo->handle;

fifo->jiffies = jiffies;
Expand Down Expand Up @@ -2150,7 +2150,7 @@ static void adaptive_coalesce_tx_interrupts(struct vxge_fifo *fifo)
static void adaptive_coalesce_rx_interrupts(struct vxge_ring *ring)
{
ring->interrupt_count++;
if (jiffies > ring->jiffies + HZ / 100) {
if (time_before(ring->jiffies + HZ / 100, jiffies)) {
struct __vxge_hw_ring *hw_ring = ring->handle;

ring->jiffies = jiffies;
Expand Down

0 comments on commit f6e92d1

Please sign in to comment.