Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
From: domen@coderock.org
To: ralf@linux-mips.org
Cc: linux-hams@vger.kernel.org,
	Marcelo Feitoza Parisi <marcelo@feitoza.com.br>,
	domen@coderock.org
Subject: [patch 1/1] drivers/net/hamradio/mkiss.c : Use of time_before macro
Date: Fri, 15 Jul 2005 00:22:02 +0200	[thread overview]
Message-ID: <20050714222202.362855000@homer> (raw)

[-- Attachment #1: time_after-drivers_net_hamradio_mkiss --]
[-- Type: text/plain, Size: 1042 bytes --]

From: Marcelo Feitoza Parisi <marcelo@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>
Signed-off-by: Domen Puncer <domen@coderock.org>

---
 mkiss.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: quilt/drivers/net/hamradio/mkiss.c
===================================================================
--- quilt.orig/drivers/net/hamradio/mkiss.c
+++ quilt/drivers/net/hamradio/mkiss.c
@@ -46,6 +46,7 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/if_arp.h>
+#include <linux/jiffies.h>
 
 #include <net/ax25.h>
 
@@ -429,7 +430,7 @@ static int ax_xmit(struct sk_buff *skb, 
 		 * May be we must check transmitter timeout here ?
 		 *      14 Oct 1994 Dmitry Gorodchanin.
 		 */
-		if (jiffies - dev->trans_start  < 20 * HZ) {
+		if (time_before(jiffies, dev->trans_start + 20 * HZ)) {
 			/* 20 sec timeout not reached */
 			return 1;
 		}

--

                 reply	other threads:[~2005-07-14 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050714222202.362855000@homer \
    --to=domen@coderock.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=marcelo@feitoza.com.br \
    --cc=ralf@linux-mips.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