kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] drivers/net/hp100.c : Use of time_before macro
Date: Fri, 08 Jul 2005 18:41:48 +0000	[thread overview]
Message-ID: <42CEC8EC.2060209@feitoza.com.br> (raw)
In-Reply-To: <425A922C.6080100@feitoza.com.br>

Use of time_before() macro, defined at linux/jiffies.h, which deal with
wrapping correctly and are nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

--- linux/drivers/net/hp100.c   2005-07-07 19:13:15.000000000 -0300
+++ linux-kj/drivers/net/hp100.c        2005-07-07 20:43:38.393191120 -0300
@@ -116,6 +116,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>

 #include <asm/io.h>

@@ -1500,7 +1501,7 @@
                printk(KERN_DEBUG "hp100: %s: start_xmit_bm: No TX PDL
available.\n", dev->name);
 #endif
                /* not waited long enough since last tx? */
-               if (jiffies - dev->trans_start < HZ)
+               if (time_before(jiffies, dev->trans_start + HZ))
                        return -EAGAIN;

                if (hp100_check_lan(dev))
@@ -1653,7 +1654,7 @@
                printk(KERN_DEBUG "hp100: %s: start_xmit: tx free mem 0x%x\n", dev->name, i);
 #endif
                /* not waited long enough since last failed tx try? */
-               if (jiffies - dev->trans_start < HZ) {
+               if (time_before(jiffies, dev->trans_start + HZ)) {
 #ifdef HP100_DEBUG
                        printk(KERN_DEBUG "hp100: %s: trans_start timing
problem\n",
                               dev->name);

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

      parent reply	other threads:[~2005-07-08 18:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-11 15:05 [KJ] [PATCH] drivers/net/hp100.c : Use of time_after() macro Marcelo Feitoza Parisi
2005-04-13 16:09 ` Nish Aravamudan
2005-04-14 21:42 ` [KJ] [PATCH] drivers/net/hp100.c : Use of time_before() macro, Marcelo Feitoza Parisi
2005-07-08 18:41 ` Marcelo Feitoza Parisi [this message]

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=42CEC8EC.2060209@feitoza.com.br \
    --to=marcelo@feitoza.com.br \
    --cc=kernel-janitors@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).