public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4] tipar char driver: wront timeout value
@ 2004-05-07 11:14 Romain Lievin
  0 siblings, 0 replies; only message in thread
From: Romain Lievin @ 2004-05-07 11:14 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Linux Kernel Mailing List

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 !"







^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-05-07 11:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-07 11:14 [PATCH 2.4] tipar char driver: wront timeout value Romain Lievin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox