public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Romain Lievin <lkml@lievin.net>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.4] tipar char driver: wront timeout value
Date: Fri, 7 May 2004 13:14:02 +0200	[thread overview]
Message-ID: <20040507111402.GA9624@lievin.net> (raw)

Hi,

this patch fixes a bug on the timeout value. The formula used to calculate jiffies from timeout was wrong.
The new formula is ok and takes care of integer computation/rounding.

This bug has already been fixed in the 2.6 kernel.

Please apply, Romain.

=============[ cut here ]===============
diff -Naur linux-2.4.26.orig/drivers/char/tipar.c linux-2.4.26/drivers/char/tipar.c
--- linux-2.4.26.orig/drivers/char/tipar.c	2004-02-18 14:36:31.000000000 +0100
+++ linux-2.4.26/drivers/char/tipar.c	2004-04-19 09:22:36.000000000 +0200
@@ -124,7 +124,7 @@
 
 /* ----- global defines ----------------------------------------------- */
 
-#define START(x) { x=jiffies+HZ/(timeout/10); }
+#define START(x) { x = jiffies + (HZ * timeout) / 10; }
 #define WAIT(x)  { \
   if (time_before((x), jiffies)) return -1; \
   if (need_resched()) schedule(); }

-- 
Romain Liévin :		<roms@lievin.net>
Web site :		http://www.lievin.net
"Linux, y'a moins bien mais c'est plus cher !"







                 reply	other threads:[~2004-05-07 11:14 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=20040507111402.GA9624@lievin.net \
    --to=lkml@lievin.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /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