netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Manuel Schölling" <manuel.schoelling@gmx.de>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	"Manuel Schölling" <manuel.schoelling@gmx.de>
Subject: [PATCH 1/3] net: vxge: Use time_is_before_jiffies() for time comparison
Date: Mon, 19 May 2014 18:47:36 +0200	[thread overview]
Message-ID: <1400518056-12089-1-git-send-email-manuel.schoelling@gmx.de> (raw)

To be future-proof and for better readability the time comparisons are modified
to use time_is_before_jiffies() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
 drivers/net/ethernet/neterion/vxge/vxge-main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index d107bcb..79f42db 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -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_is_before_jiffies(fifo->jiffies + HZ / 100)) {
 		struct __vxge_hw_fifo *hw_fifo = fifo->handle;
 
 		fifo->jiffies = jiffies;
@@ -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_is_before_jiffies(ring->jiffies + HZ / 100)) {
 		struct __vxge_hw_ring *hw_ring = ring->handle;
 
 		ring->jiffies = jiffies;
-- 
1.7.10.4

             reply	other threads:[~2014-05-19 16:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 16:47 Manuel Schölling [this message]
2014-05-19 16:51 ` (unknown), Manuel Schölling
2014-05-19 16:51   ` [PATCH] net: vxge: Use time_is_before_jiffies() for time comparison Manuel Schölling
2014-05-19 17:35     ` Joe Perches
2014-05-19 20:56       ` [PATCH v3] vxge: Use time_before() Manuel Schölling
2014-05-19 20:59       ` [PATCH] " Manuel Schölling
2014-05-21 20:43         ` David Miller
2014-05-19 16:53 ` [PATCH 1/3] net: vxge: Use time_is_before_jiffies() for time comparison Manuel Schoelling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400518056-12089-1-git-send-email-manuel.schoelling@gmx.de \
    --to=manuel.schoelling@gmx.de \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).