Skip to contentSkip to conversation

tipar char driver: wront timeout value

PATCH New Romain Lievin 1 participant 1 message May 7, 2004 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tipar char driver: wront timeout value

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 ]===============

drivers/char/tipar.c +1 -1
diff -Naur linux-2.4.26.orig/drivers/char/tipar.c linux-2.4.26/drivers/char/tipar.c
@@ -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(); }
Signature · 3 lines
Romain Liévin :		<[email protected]>
Web site :		http://www.lievin.net
"Linux, y'a moins bien mais c'est plus cher !"