tipar char driver: wrong timeout value
PATCH 1/1 tipar char driver: wrong timeout value
Hi,
this patch (2.4 & 2.6) fixes a bug about the timeout value. The formula used to calculate jiffies from timeout is wrong.
The new formula is ok and takes care of integer computation/rounding. There is the same bug in the tiglusb.c module which will be fixed by another patch.
Please apply, Romain.
==============================[cut here]================================
drivers/char/tipar.c +1 -1
@@ -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(); }
==============================[cut here]================================
drivers/char/tipar.c +1 -1
@@ -121,7 +121,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(); }
==============================[cut here]================================
Signature · 3 lines
Romain Liévin (roms): <[email protected]> Web site: http://www.lievin.net "Linux, y'a moins bien mais c'est plus cher !"