public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] joydev: fix HZ->millisecond transformation
@ 2002-12-16 19:27 Bjorn Helgaas
  2002-12-20 10:41 ` george anzinger
  0 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2002-12-16 19:27 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: vojtech, linux-kernel

* fix a problem with HZ->millisecond transformation on
  non-x86 archs (from 2.5 change by vojtech@suse.cz)

Applies to 2.4.20.

diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Mon Dec 16 12:16:32 2002
+++ b/drivers/input/joydev.c	Mon Dec 16 12:16:32 2002
@@ -50,6 +50,8 @@
 #define JOYDEV_MINORS		32
 #define JOYDEV_BUFFER_SIZE	64
 
+#define MSECS(t)	(1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
+
 struct joydev {
 	int exist;
 	int open;
@@ -134,7 +136,7 @@
 			return;
 	}  
 
-	event.time = jiffies * (1000 / HZ);
+	event.time = MSECS(jiffies);
 
 	while (list) {
 
@@ -279,7 +281,7 @@
 
 		struct js_event event;
 
-		event.time = jiffies * (1000/HZ);
+		event.time = MSECS(jiffies);
 
 		if (list->startup < joydev->nkey) {
 			event.type = JS_EVENT_BUTTON | JS_EVENT_INIT;


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-12-21 16:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-16 19:27 [PATCH] joydev: fix HZ->millisecond transformation Bjorn Helgaas
2002-12-20 10:41 ` george anzinger
2002-12-20 13:24   ` Vojtech Pavlik
2002-12-20 14:52     ` Joe Korty
2002-12-20 17:24     ` george anzinger
2002-12-20 17:35       ` Vojtech Pavlik
2002-12-20 18:16         ` george anzinger
2002-12-21  9:18           ` Vojtech Pavlik
2002-12-21 16:46             ` george anzinger

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